parameter problem

  • Thread starter Thread starter Nabeel
  • Start date Start date
N

Nabeel

Hi,
I need to pass parameter to a stored procedure, based on values of a text
box in a form, how can it be done? The stored procedure runs fine with named
parameters.
 
This Stored procedure is not used as a data source of a form, actually i
want run a make table query based on a value in text field of a form. where
i press a command button and the table is made. I used to get this done in
Access by referring to the field on form in the query . . but this approach
does not seem to work in .adp
 
If I understand you correctly, I would suggest to use a command object (with
parameters) to call the stored procedure. The stored procedure can then
create the table.

Set com = New ADODB.Command
com.ActiveConnection = CurrentProject.Connection
com.CommandType = adCmdStoredProc
com.CommandText = "sp_MySproc"
com.Parameters.Refresh 'note this causes another visit to the
back end
com.Parameters("@param1") = Me.txtParam1
com.Parameters("@param2") = Me.txtParam2
com.Execute
 
I tried the code it gives the following error
"Cannot run SELECT INTO this database. The database owner must run
sp_dboption to enable this option"
I have been using Access but never had this problem. Please help

BTW I tried the same code with a select query, it doesn't show me any
result.
 
please post the code that gives the error

Nabeel said:
I tried the code it gives the following error
"Cannot run SELECT INTO this database. The database owner must run
sp_dboption to enable this option"
I have been using Access but never had this problem. Please help

BTW I tried the same code with a select query, it doesn't show me any
result.
 
Found the error in code and solved the problem. . . . .
but one problem still remains How do i run "sp_dboption " to make sql server
enable make table queries.....

Thanks for your help
 
Back
Top