| | |
Auto number problem
![]() |
try the following code :-
take two labels(label1 and label2) and a textbox(Text1)
here the database ->"aa.mdb"
table ->"aa"
fields ->"id" (long,autonumber) ; "name" (text)
take two labels(label1 and label2) and a textbox(Text1)
here the database ->"aa.mdb"
table ->"aa"
fields ->"id" (long,autonumber) ; "name" (text)
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim conn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim str As String str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\aa.mdb;Persist Security Info=False" conn.ConnectionString = str conn.Open str = "select * from aa where id = " & Val(Text1.Text) rs.Open str, conn, adOpenStatic, adLockReadOnly If rs.RecordCount > 0 Then Label1.Caption = rs!id Label2.Caption = rs!Name Else MsgBox "No record found." End If Text1.Text = "" Text1.SetFocus
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
Similar Threads
- Random Number Problem For Lottery Program (Visual Basic 4 / 5 / 6)
- reversing number problem. (C)
- Adobe auto updater problem (Windows Software)
- Serial Number in Data Reports (Visual Basic 4 / 5 / 6)
- generating an auto number (Visual Basic 4 / 5 / 6)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
- Start button and Quick Launch problem on boot (Windows 95 / 98 / Me)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: change color of border
- Next Thread: need help for project
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





