[AccessD] Storing SQL in VBA

paul.hartland at fsmail.net paul.hartland at fsmail.net
Tue Aug 1 10:24:21 CDT 2006


Only done similar in VB6 not tried it in Access VBA, example below (off top of head):
Dim rsGetData As ADODB.Recordset
set rsGetData = YourSQLConnection.Execute("YourQuery")
Suppose then you could write the recordset to a table in some way, or can you have a form or report based on a recordset ?

Paul 






Message Received: Aug 01 2006, 04:01 PM
From: "Kaup, Chester" 
To: "Access Developers discussion and problem solving" 
Cc: 
Subject: [AccessD] Storing SQL in VBA

I want to store and execute an action query in VBA. Did some research
and found RunSQL will not work on action queries. The execute method
will run the action query SQL but returns no recordset. So is there a
way to store and execute an action query in VBA and then use the
results?



Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799





No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced.



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list