|
-
Feb 20th, 2000, 01:49 AM
#1
Thread Starter
Junior Member
-
Feb 20th, 2000, 03:50 AM
#2
Hyperactive Member
It depends on what you are using to connect to the database.
I'll give you an example of what I use to play with databases.
dim dbsData as database, rcdTable as recordset, lngIDnum as long
lngIDnum = "123456"
set dbsData = OpenDatabase("mydata.mdb")
'this is the name of what ever database you connect to
set rcdTable = dbsData.OpenRecordset("Select * from table where IDfield = " & lngIDnum)
'using a variable to show how it would work
'if you don't want to - ("Select * from table where IDfield = 123456")
if rcdTable.eof then
'this record ID was not found
else
'record found
msgbox "Found record.", vbokonly, "Found"
end if
rcdTable.close
dbsData.close
This would check for a record with id of 123456 in field IDfield, in table Table from database mydata.mdb
Hope this helps.
-
Feb 20th, 2000, 04:10 AM
#3
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|