WILLIEWANKA
Technical User
I'm trying to create a GUI for business users to create reports using Teradata as the database.
It will use a series of pass through queries to create the tables need for the final report. I've gotten the interface set up to select the required tables and create the pass through queries. The only problem I am running into is whenever I begin to run the pass through queries the ODBC dialog box will pop up for each query (there are about 5 total). Is there any way for me to open a DSN connection through ODBC, then trap that connection string and pass it on to each of the pass throughs when they are created? I know how to add
But I just can't find out how to get that dialog to pop up to create that first connection string. Any ideas? Here's the code to change the pass through queries. I've got a function to see if the query exists (ffindquery), if it does then it changes the sql, if not, it creates the query.
It will use a series of pass through queries to create the tables need for the final report. I've gotten the interface set up to select the required tables and create the pass through queries. The only problem I am running into is whenever I begin to run the pass through queries the ODBC dialog box will pop up for each query (there are about 5 total). Is there any way for me to open a DSN connection through ODBC, then trap that connection string and pass it on to each of the pass throughs when they are created? I know how to add
Code:
qdf.connectionstring ("DSN=blah"yadda yadda yadda)
Code:
Private Function changequery(qryname As String, strSQL As String)
Dim db As Database
Dim qdf As QueryDef
Set db = CurrentDb
If ffindQuery(qryname) = True Then
Set qdf = db.QueryDefs(qryname)
Else
Set qdf = db.CreateQueryDef(qryname)
End If
qdf.SQL = strSQL
Code:
'qdf.connectionstring ("ODBC;DSN=mydsn;UID=myuser;PWD=mypwd;") this is where I need to get the connection string
Code:
qdf.Close
Set qdf = Nothing
Set db = Nothing
End Function