Hi all,
How can I retrive records from a SQL stored procedure in a Access form?
I have this code:
=========================
'Sets values
Set cnSQL = New ADODB.Connection
Set cmd = New ADODB.Command
'Opens a connection to the SQL server
cnSQL.Open _
"Provider= sqloledb;Driver=SQL Server;" & _
"Server=Labserver2;" & _
"Database=Kunddata;UID=sa;PWD=MyPwd"
With cmd
.ActiveConnection = cnSQL
.CommandText = "sp_Mosaic_Analys"
.CommandType = adCmdStoredProc
.ReturnsRecords = True
.Execute
'Closes and resets the recordset
cnSQL.Close
Set cmd = Nothing
=======================
But how can I get the result to a Access form?
Shouldn't it be somewhere the name of a pass-through query?
Kent J.
How can I retrive records from a SQL stored procedure in a Access form?
I have this code:
=========================
'Sets values
Set cnSQL = New ADODB.Connection
Set cmd = New ADODB.Command
'Opens a connection to the SQL server
cnSQL.Open _
"Provider= sqloledb;Driver=SQL Server;" & _
"Server=Labserver2;" & _
"Database=Kunddata;UID=sa;PWD=MyPwd"
With cmd
.ActiveConnection = cnSQL
.CommandText = "sp_Mosaic_Analys"
.CommandType = adCmdStoredProc
.ReturnsRecords = True
.Execute
'Closes and resets the recordset
cnSQL.Close
Set cmd = Nothing
=======================
But how can I get the result to a Access form?
Shouldn't it be somewhere the name of a pass-through query?
Kent J.