|
-
October 15th, 2001, 01:41 PM
#1
ADO-Dataenvironment Question
I use the following instructions to attach to an
Access database table using ADO and the Data environment:
DataEnvironment1.phone1
Set rs = DataEnvironment1.rsPhone1
How can I change "Phone1" in these instructions or build these instructions at runtime to reflect a different table name(the table name is being selected from a long list of table names at runtime)
Thanks---Tennisnet
-
October 16th, 2001, 04:34 PM
#2
Re: ADO-Dataenvironment Question
Instead of using a DataEnvironment command to open your recordset, try to open the recordset dynamically using the DataEnvironment connection (DataEnvironment1.cnn) like this:
set rs = DataEnvironment1.cnn.Execute("SELECT * FROM " & strYourVariable
where strYourVariable is a table name in your database.
Alternately, you can define a command for each table, and then use a select case to determine which command to use at run time.
Hope this helps
Jason
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
|