C++ retrieving data from database.  
Author Message
Agent00





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

Hi,

How come when I use C++ to read data from Access database, it only let me read up to 255 chars instead of all the text I have in that specific cell. What's the right command I have to use in C++ to be able to read all the text in the cell. Please help!! thanks in advance.

Jason




Visual Studio Tools for Office26  
 
 
Cindy Meister





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

Hi Jason

The "Office" in Visual Studio Tools for Office doesn't mean all Office questions are handled here :-) This is a technology addin for Word, Excel and Outlook... for VB.NET and C#. Nothing here to do with Access or C++. So the chances of your encountering someone who can help you are slim.

Whether one of the Access groups such as

http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.access.modulesdaovba&lang=en&cr=US

can help you, I can't say. What I can tell you is:

- Only MEMO fields in Access can contain more than 256 characters.

- If you have a MEMO field, and can't read the data from it, then based on my experience it's probably an issue with the technology/driver/provider you're using to connect to the database. A good place to pursue this might be a group for the data connection method (JET/DAO, ADO/OLE DB, ODBC).



 
 
Jonathan Caves - MSFT





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

This is not a C++ related question: you should try one of the Access newsgroups

http://msdn.microsoft.com/office/program/access/community/#Newsgroups



 
 
Agent00





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

I think I'm not saying it correctly. I don't have problem with access database. What I'm trying to do is write a C++ sql command to select data from access database. I used the select command but it only select up to 255 chars and not everything in that specific cell. I don't know what I did wrong with the sql select command but it didn't work the way I wanted. I don't think access forum could answer this question because this question is from C++ select sql command and not access. Sorry if I confused you!! but thanks for the reply. Can you still help me with the sql select command in C++.

Thanks

Jason



 
 
Agent00





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

sorry about that and thanks, I will try your advice and you been very helpful, thanks!!

Jason



 
 
Jonathan Caves - MSFT





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

C++ knows nothing about Access, SQL or SELECT commands - so it is very unlikely that C++ is a fault here. You really would be better off asking your question on a forum/newsgroup that deals with database issue.

 
 
AndrewAPlus





PostPosted: Visual Studio Tools for Office, C++ retrieving data from database. Top

Your question is a little vauge. I suspect that you are trying to use some form of ADO to retrieve a TEXT field (which is limited to 255 characters in MS-Access). It sounds like you expected more than 255 characters, so maybe you have a MEMO field.

At any rate, the problem is likely that you are trying to retrieve MEMO data into the wrong ADO data type. Even if you're not using ADO, you still are using the wrong data type.