jalldridge
Registered User.
- Local time
- Today, 20:42
- Joined
- May 3, 2005
- Messages
- 60
Hi guys
I want to be able to run a select query such as:
select distinct email_address from tbl_download where email_addres='fred@xyz.com'
in VBA code in access. I then want to be able to see if my result set contains any info ie there way an email address. If yes I will do one thing, if no another.
However as yet I've not found a way in access to run a select statment and get hold of the resultset.
Any pointers greatly appreciated. Heres what I tried to date :-(
If I run this I get an error at the open command that states
the database has been placed in a state bu user admin on machine XX that prevents it from being opened or locked.
I managed to do an update ok by using docmd.runsql but couldnt find a docmd.method for running select command
Thanks
I want to be able to run a select query such as:
select distinct email_address from tbl_download where email_addres='fred@xyz.com'
in VBA code in access. I then want to be able to see if my result set contains any info ie there way an email address. If yes I will do one thing, if no another.
However as yet I've not found a way in access to run a select statment and get hold of the resultset.
Any pointers greatly appreciated. Heres what I tried to date :-(
Code:
Set rst = New ADODB.Recordset
'rst.CursorType =adOpenDynamic
rst.Open "select distinct email_address from tbl_download where email_addres='fred@xyz.com'", curconn, , , adCmdText
srtv = rst![email_Address]
rst.Close
If I run this I get an error at the open command that states
the database has been placed in a state bu user admin on machine XX that prevents it from being opened or locked.
I managed to do an update ok by using docmd.runsql but couldnt find a docmd.method for running select command
Thanks