|
-
May 7th, 1999, 10:12 AM
#1
Error Opening a Recordset
I'm trying to open a CRecordset passing an SQL string and I get the folowing error:
"No Columns were found to calling SQLFetchScroll/SQLExtendedFetch"
Sugestions?
-
May 8th, 1999, 11:26 AM
#2
Re: Error Opening a Recordset
If you can post the quey that you are passing I will take a look. It is probably syntax in the string.
TKE Dave
-
May 10th, 1999, 02:22 PM
#3
Re: Error Opening a Recordset
Hi...
This is the code:
CDatabase mdb;
mdb.Open("ODBC;DSN=ODBC_GEO");
CRecordset rs2(&mdb);
CString SQL = "Select * from Equipamentos"; //Equipamentos is an Access 97 //table
rs2.Open(AFX_DB_USE_DEFAULT_TYPE,SQL,CRecordset::none);
//Here the error occurs....
Thanks for the atention.....
-
May 10th, 1999, 06:34 PM
#4
Re: Error Opening a Recordset
Just a couple of quick things to check.
What is the default type of the recordset?
Have you checked the spelling of the table names(I am sure that you have).
Is the database always an Access database?
If so, have you considered using DAO?
Can you exhibit the same behavior through DAO?
If not, you may want to check the setup of the ODBC datasource.
Are you using Microsoft's ODBC pack or is it third party?
At first glance it looks like the syntax is correct, I would almost have to step through the code to know for sure. If you are still stumped, you can zip up the project and send it to me. I am running VC 6.0 with Access 97 and the latest MDAC install. Sorry I couldn't see the problem from your post.
If you need my e-mail address post a message here and I will send it to you.
God Luck
TKE Dave
-
May 12th, 1999, 01:28 PM
#5
Re: Error Opening a Recordset
Hi again.....
I'll try to answer your questions.
1) The default type is snapshot(I think).
2) Yes, the spelling of the table name is correct.
3) No, the database is not always an Access table.
4) Yes I'm using Microsoft ODBC pack version 3.0.
If you send me your e-mail I can send the project to you. I'm using VC 5.0 with Access 97.
Thanks again.
-
May 12th, 1999, 01:53 PM
#6
Re: Error Opening a Recordset
Your problem is that you are trying to open a CRecordset object. You should derive a class from CRecordset and Open it instead. You can't use a CRecordset in the context of your code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|