If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Generate ID with Integer and Character type

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-14-04, 23:12
ric1982 ric1982 is offline
Registered User
 
Join Date: Jun 2004
Posts: 4
Generate ID with Integer and Character type

Hi,
can anyone show me the way to generate ID with Integer and Character type?
like JobID: PA001,PA002,PA003....in database

Below is my code that only generate number:
With adoJob.Recordset
.MoveLast
JobID = adoVendor.Recordset.Fields(0) + 1
.AddNew
txtJobID.Text = vendorID
MsgBox "Your New Job ID is " & txtJobID.Text
End With

------------------------------------------------------------
Well, below is my problem that involve alphabet with number
(It will show "type mismatch" message):

With adoJob.Recordset
.MoveLast
JobID = adoJob.Recordset.Fields(0) + 1
.AddNew
txtJobID.Text = "PA00" & vendorID
MsgBox "Your New Vendor ID is " & txtJobID.Text
End With

-------------------------------------------------------------
i am using ADODC recordset,
can anyone help me
thankx


also anyone know how to set Expression?
like Numbering System: "CQ/03/002"
CQ mean company name
03 mean year 2003
002 mean Project number
so if user enter "CQ/00w/wd", it will say invalid expression
Reply With Quote
  #2 (permalink)  
Old 06-15-04, 00:35
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
I think that you need Str() to make the number a string.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On