|
-
Jun 26th, 2007, 09:35 AM
#1
Thread Starter
Lively Member
Connecting to Sql to retrieve data
Hi,
I never tried to connect to a database before and after reading a few previous posts and googling - I am confused as to the best way to connect to a SQL database to retrieve a single field in one table. ( I just want to get get the value from this field) to use as a status.
I don't want to update the DB at all just simpy read from it.
Can somebody point me in the right direction to simply do this?
An example would be great if possible.
thanks for you assistance
Steve
-
Jun 26th, 2007, 09:43 AM
#2
Re: Connecting to Sql to retrieve data
You make a connection to the database (use ADODB Code). Create a recordset. Write SQL Statement to retrieve data from the database. Asign the SQL Statement to the recordset and then open the recordset.
If the recordset contains data (not at BOF Or EOF) then assigne the returned value to a variable or some other oject on the form.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jun 26th, 2007, 01:12 PM
#3
Addicted Member
Re: Connecting to Sql to retrieve data
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
|