Senin, 02 Juni 2014

[MS_AccessPros] Run-time error 91 when executing Stored Procedure in MSAccess 2013

 

I am executing an stored procedure in SQL 2012 from MSAccess 2013.


The Procedure is in command button in a form.


At Set cmd=cmd.execute  a Run-time error 91 (Object variable or With block variable not set) is generated.


Any suggestions?


Thanks

Norbert


Private Sub cmdBackup_Click()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmd As ADODB.Command
Dim strConnect As String

strConnect = "Provider=SQLNCLI11;Server=ISMSERVER2;Database=ISMUTIL;Trusted_Connection=Yes;"
Set cnn = New ADODB.Connection

cnn.Open strConnect

Set cmd = cmd.Execute
cmd.ActiveConnection = cnn
cmd.CommandText = "dbo.get_isdmdata_database_backups"
cmd.CommandType = adCmdStoredProc

Set rst = cmd.Execute

Set rst = Nothing
Set cnn = Nothing
Set cmd = Nothing

End Sub

__._,_.___

Posted by: drnorbert@msn.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

.

__,_._,___

Tidak ada komentar:

Posting Komentar