954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Database problem

Dear All.
I have developed College management system ,and using VB6 tools as front and MS Access as database ,I want to generate autoID of students according to their technologies,for example for Electrical....... 01ELE,For Computer ....... 02Comp ,for Civil.... 03CL etc or Pls Give me suggestion t o create new tables for every technologies?

zebnoon
Junior Poster
104 posts since Jun 2010
Reputation Points: 4
Solved Threads: 0
 

Hi Zeb,

You can not set the field in your table to auto increment, it will only accept integers type like 1,2,3,4 etc. The way around this is to do the following -

''Open your recordset.... SELECT * FROM etc...

Dim xCount As Integer, strRec As String

xCount = rsRecordset.Recordcount
xCount = xCount + 1

strRec = xCount & "ELE"


Now, when you add a new record to your database, use strRec as the field id.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: