ADO Open recordset problem 
Author Message
 ADO Open recordset problem

Hi,

When I call the open method on a ADO recordset object something strange
happens.

Here is my code:
m_sSQL = "popweb..usp_sel_report_all"
m_adoRs.Open m_sSQL, m_adoConn, adOpenStatic

When I run this code snippet, I get the following error message:

[INTERSOLV][ODBC SQL Server driver][SQL Server]Stored procedure
'popweb..usp_s' not found. Specify owner.objectname or use sp_help to check
whether the object exists (sp_help may produce lots of output).

It says that 'popweb..usp_s' not found. If I ad spaces to the m_sSQL
variable it works...
m_sSQL = "popweb..usp_sel_report_all                                  "
m_adoRs.Open m_sSQL, m_adoConn, adOpenStatic

This last codelines work. Can anyone tell me why it seems to truncate the
string before
it sends it to the database?

Regards,
Ulf Erik Forsbakk    



Sun, 12 Mar 2000 03:00:00 GMT  
 ADO Open recordset problem

I believe your problem is with the "Options" parameter of the Open method.
There is a named constant called adCmdText that you have to use there to
tell the method to treat your "Source" parameter (the one with the SQL
statement--m_sSQL in your case) as a SQL command.  Evidently, the default
setting is to treat the Source parameter as the name of a stored procedure.
 Remember that ADO/OLEDB is intended to be used by heterogeneous data
sources, many of which that will not understand SQL.

HTH,
Dan Read
--
If you wish to e-mail me directly, remove the XX from the front of my
address.



Quote:
> Hi,

> When I call the open method on a ADO recordset object something strange
> happens.

> Here is my code:
> m_sSQL = "popweb..usp_sel_report_all"
> m_adoRs.Open m_sSQL, m_adoConn, adOpenStatic

> When I run this code snippet, I get the following error message:

> [INTERSOLV][ODBC SQL Server driver][SQL Server]Stored procedure
> 'popweb..usp_s' not found. Specify owner.objectname or use sp_help to
check
> whether the object exists (sp_help may produce lots of output).

> It says that 'popweb..usp_s' not found. If I ad spaces to the m_sSQL
> variable it works...
> m_sSQL = "popweb..usp_sel_report_all                                  "
> m_adoRs.Open m_sSQL, m_adoConn, adOpenStatic

> This last codelines work. Can anyone tell me why it seems to truncate the
> string before
> it sends it to the database?

> Regards,
> Ulf Erik Forsbakk    



Sun, 12 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO Open Recordset problem

2. ADO Open recordset problem

3. Open ADO recordset on another ADO recordset - possible?

4. ADO-Problems w. Recordset.Open method

5. Problem opening recordset for update ADO 2.1/Jet 4.0/Access 2000 stored proc

6. ADO Recordset .OPEN problem

7. Problem with SQL on ADO Recordset Open

8. Problem opening recordset for update ADO 2.1/Jet 4.0/Access 2000 stored proc

9. ADO 2.5 Recordset.Open Timeout problem

10. ADO fails to release Recordset cursor after opening disconnected Recordset

11. Opening an ADOX Catalog Whilst ADO Recordset is Open

12. Opening recordsets(OpenRecordset vs. Recordset.Open)

 

 
Powered by phpBB® Forum Software