I'm trying, successfully in most cases, to extract data from systems dependent on a system DSN. Oddly if I use a simple query file and run this through excel I have no problems at all.
However, when wrapping the query into an application using the following very innocuous code I often have a timeout problem.
Would it be quicker to use DAO?
Dim adoConn As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
sqltext = "SELECT datatable.purchase_date, etc etc "')"
'Open DSN Connection
Set adoOutfile = fso1.CreateTextFile("C:\ Query.txt", True)
adoOutfile.Write (sqltext)
adoOutfile.Close
adoConn.Open "DSN=mydsn;DATABASE=mydatabase;UID=myuid;"
adoRS.Source = sqltext
Set adoRS.ActiveConnection = adoConn
adoRS.Open
If I'm missing something please do let me know!!!
However, when wrapping the query into an application using the following very innocuous code I often have a timeout problem.
Would it be quicker to use DAO?
Dim adoConn As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
sqltext = "SELECT datatable.purchase_date, etc etc "')"
'Open DSN Connection
Set adoOutfile = fso1.CreateTextFile("C:\ Query.txt", True)
adoOutfile.Write (sqltext)
adoOutfile.Close
adoConn.Open "DSN=mydsn;DATABASE=mydatabase;UID=myuid;"
adoRS.Source = sqltext
Set adoRS.ActiveConnection = adoConn
adoRS.Open
If I'm missing something please do let me know!!!