Hi.
I have an adodb connection to an sql server. I execute sql and get a recordset. I would like to write that recordset to a local Access table in the current access database...
1) I am having problems writing the ADO recordset to a table. Any help??
2) Is there anyway I can use an sql "into" a local table that does not exist??? like: Select [Project Number] into Local_Table from Raw_Data_SV. It seems that when I put the "into" the execute tries to create the table on the server and not locally. I want it locally.
Code:
Public Sub Make_TEP_Table(tablename As String, sql_txt As String)
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
cn.Provider = "sqloledb.1"
cn.Properties("Data Source").Value = "XXXXXXXX"
cn.Properties("Initial Catalog").Value = "IDB"
cn.Properties("Integrated Security").Value = "SSPI"
cn.Open
sql_txt = "Select [Project Number] from [Raw_Data_SV]"
Set rs = cn.Execute(sql_txt)
rs.MoveFirst
Thanks.
Steve
Harrisburg, PA