
Insert Records from SQL Server Passthrough Query
Hello,
I am creating a connection to a SQL Server 7 database without using a DSN,
and executing a stored procedure. I need to insert the recordset to a
table. Do I need to loop through the recordset, or is there an SQL way of
doing this
(i.e. INSERT INTO MyTable SELECT MyRecord FROM ???)
Thanks in advance, S{*filter*}
Below is my connection string:
Dim cnnFlash As New ADODB.Connection, rsFlash As ADODB.Recordset
Dim strParm00 As String, strParm01 As String, strParm02 As String
strParm01 = "CustomerContract"
strParm02 = "ListPrice"
strParm00 = "'" & strParm01 & "', " & "'" & strParm02 & "'"
'Open a connection by referencing the ODBC driver.
cnnFlash.Open "Driver={SQL
Server};Server=MyServer;uid=Test;pwd=test123;Database=dbMySS7"
' Create a Recordset by executing an SQL statement.
Set rsFlash = cnnFlash.Execute("spTest " & strParm00, adCmdStoredProc)