jgoodman00
Programmer
- Jan 23, 2001
- 1,510
I have the following sub, which passes parameters into a SQL server sp.
Private Sub cmdViewManager_Click()
On Error Resume Next 'GoTo Cmd_Err
Dim cmd As ADODB.Command
Set cnn = CurrentProject.Connection
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "qryGenerateResults"
cmd.Parameters("@HierarchyID"
= Me.txtAssetCriteria
cmd.Parameters("@LocationID"
= Me.txtBRSCriteria
cmd.Parameters("@Priority"
= Me.txtPriorityCriteria
There is a problem with the parameters collection of the cmd object. If SQL server has been installed locally, the collection is available, & can be assigned correctly. However, if the local computer has not had an installation of SQL server the cmd object, & its parameters collection within is incorrect. It merely gives an error stating Incorrect syntax near ')'.
I have searched the knowledge base, but to no avail. Has anybody else seen this?
James Goodman
Private Sub cmdViewManager_Click()
On Error Resume Next 'GoTo Cmd_Err
Dim cmd As ADODB.Command
Set cnn = CurrentProject.Connection
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "qryGenerateResults"
cmd.Parameters("@HierarchyID"
cmd.Parameters("@LocationID"
cmd.Parameters("@Priority"
There is a problem with the parameters collection of the cmd object. If SQL server has been installed locally, the collection is available, & can be assigned correctly. However, if the local computer has not had an installation of SQL server the cmd object, & its parameters collection within is incorrect. It merely gives an error stating Incorrect syntax near ')'.
I have searched the knowledge base, but to no avail. Has anybody else seen this?
James Goodman