We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,610 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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?

2
Contributors
1
Reply
1 Hour
Discussion Span
1 Year Ago
Last Updated
2
Views
zebnoon
Junior Poster
104 posts since Jun 2010
Reputation Points: 4
Solved Threads: 0
Skill Endorsements: 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
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0516 seconds using 2.62MB