Question

Locked

Transfer Access View/Query to another *.mdb

By uditha ·
I'm lloking for a way to transfer a query from one .mdb to another (Using vb6). I can transfer Tables using ADOX.Tales and ADOX.Catelog ...... There is a way to transfer Views using <>.Views.Append "",Cmd .. But how can i pick the sql statement from the source View ... Any body know the answer ????

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Could Use DAO QueryDef

by teebes2004 In reply to Transfer Access View/Quer ...

Using DAO you could set a QueryDef object using the name of the query on the source database. The SQL property contains the SQL string. Create another QueryDef object with the name of the query on the target database, set the SQL property and append this QueryDef object to the target database object's QueryDefs collection.

I hope this helps. I know this works as I have done this before, though I may be bit hazy on the the terminology details as it has been a while. :)

Collapse -

is this a one-shot, or do you need it to update automatically?

by jerry~Beans&Bytes In reply to Could Use DAO QueryDef

if you need the 2nd database to update automatically, yeah, use the code.

if it's just a one-shot, what i usually do (i.e. to move an SQL from dev to prod) is open the query in Edit mode, SQL View and simply copy the text, then go to the 2nd mdb, open the query and paste it in.

no muss, no fuss, and it gives me one more look at the code, just in case.

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Software Forums