Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I normally use SQL queries in my VBA code like this:
Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim sql As String cn.Open "Driver={SQL Server};Server=ServerName;Database=DBNAME;Uid=x;Pw d=y" sql = "SELECT * FROM Table1 WHERE Field1 = 'MyValue'" rs.Open sql, cn It passes the string to the datebase and returns the results as a recordset. But now I have a query so large that it can not easily be contained as a string in my VBA. Is there a way to refer to a text file where it is kept, or some other idea? tod |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Importing Data via Web Query - Can values be passed to query? | Excel Discussion (Misc queries) | |||
Edit Query from Excel will not open query in MSQuery | Excel Programming | |||
Problem with .Background Query option of ODBC Query | Excel Programming |