 |
|
 |
I am trying to insert a Blob into a sqlite database using your code.
I don't understand how the 'Bind' functions in CSQLStatement class are called nor how this class fits with the 'CDbSqlite' class.
Do you have any example code espially that deals with Blobs ?
Any help is much appreciated.
Regards,
Alan Buchanan
|
|
|
|
 |
|
 |
when run the w32Test in "Download demo project w/source" that you provided in VS2005,detected Memory leaks.
At the end of function CTestDlg::OnPbReview(),I added:
if(stmt)
{
delete[] stmt;
}
Then no memory leaks.
modified on Friday, December 3, 2010 3:44 AM
|
|
|
|
 |
|
 |
Excellent work!
but, I find a bug when calling SelectStatement in VS2005, it seems that LPCTSTR is not equal to CString.
in function:
int
CDbSQLite::SelectCallback(void *p_data, int num_fields, char **p_fields, char** /*p_col_names*/)
{
ResultTable* res = reinterpret_cast<ResultTable*>(p_data);
ResultRecord record;
for ( int i=0; i < num_fields; i++ )
{
CString szField = CString(p_fields[i]);
record.m_fields.push_back(szField); // this row works abnormal in vs2005
}
res->m_records.push_back(record);
return 0;
}
you can use:
class ResultRecord
{
public:
std::vector<CString> m_fields;
};
instead of
class ResultRecord
{
public:
std::vector<LPCTSTR> m_fields;
};
|
|
|
|
 |
|
 |
The code worked well in my projects. Thanks!
|
|
|
|
 |
|
 |
Hi,
I'm very glad to see that you've done this wrapper, i've been looking all over for such a thing.
Now, i'm trying to run this on Windows Mobile 5 with VS 2005. I followed all the steps you said, i converted all the projects and made all the changes for the newer version of WM and VS. It builds ok, but when i try to deploy it on the emulator, i get this error: Unable to start program: '%CSIDL_PROGRAM_FILES%\wceTest.exe'
I try to run on the device itself, by copying the wceTest.exe on the device. I still get the error.
Do i have to register any dll or something to make it work?
Could you help me please with this, i really need this wrapper, but i dunno how to make it work.
Thanks a lot!
|
|
|
|
 |
|
 |
Keep in mind that I am just speculating on your problem. It seems to me that you may not have your emulator configured with a full ActiveSync partnership. This article at O'Reilly might help. Please let us all know if it does.
|
|
|
|
 |
|
 |
One other thing occurred to me as I re-read your post. I'm assuming you are using the wrapper as a DLL. Did you sync both the test application and DLL to the device/emulator?
|
|
|
|
 |
|
 |
I guess that the problem was that the executable was not able to find the DLL's needed.
I tried to copy on the device in the same directory wceTest.exe and wceSQLite3.dll and still didn't work. And then i took a look on wceTest project properties, and the Deployment -> Additional Files box was left blank. I added there some DLL's that somehow my Visual Studio missed to put: msvcr80.dll, atl80.dll, msvcr80d.dll, MFC80UD.dll, and then the wceSQLite3.dll, and i checked "yes" on Register Output, and now it works.
I hope this will help ppl having the same problem.
Thanks very much for the quick response and good luck with your coding
|
|
|
|
 |
|
 |
hi everyone
Can I uses SQLite to connect to MS SQL Server and read and write some data to it ?
do you have any idea ?
please help!!!
|
|
|
|
 |
|
 |
You cannot.
Actually, the question misses the point of using SQLite. Furthermore, there is not enough information in your post that is sufficient to offer you suggestion(s) about how you might proceed. For example, development language, etc. I recommend you search code project to see if you can find anything that will help you with SQL Server. For example, there is at least one ADO wrapper on this site that I have used in the past on a C++ project. If you use any of the .NET family of languages, then you already have everything you need.
|
|
|
|
 |
|
 |
Tanks,
I have find som information about ODBC is not supported on CE and OLEDB driver is not available form Win CE device.
Can I uses ADO wrapper to direct access to SQL server in my network.
I uses C++ language, but I can not finde some examples in C++.
Thank you very much !
|
|
|
|
 |
|
 |
My previous response included a hyperlink that would have displayed numerous ADO projects for you to consider. Several of them written in C++, .NET, etc. Just click on the highlighted phrase "code project" because it is actually a link to a page of search results.
Finding ADO examples should not be difficult. It is definitely a skill I encourage you to develop because it will be fundamental to accomplishing your task. For what it is worth, I ran a simple keyword search here on code project using "ADO wrapper" and came up with this link.
Here's wishing you good luck and Happy Fishing!!!
modified on Monday, May 4, 2009 6:53 AM
|
|
|
|
 |
|
 |
Using source from sqlite 3.4.0 causes DbSQLite to fail in compilation with the following message.
error C2065: 'CHAR_BIT' : undeclared identifier
|
|
|
|
 |
|
 |
You have reported a common problem that occurs when the open source package for SQLite is updated while the source code for this article is not (See Warnings and Disclaimers) maintained.
Since this is obviously a simple source code version problem, please advise everyone how you solved it so it would compile. In that way, you can help others who follow in your footsteps.
|
|
|
|
 |
|
 |
hello.
i use VC++.NET 2005 and, i don't know, how add and use this dll in my program. please help me. tell me clearly.
|
|
|
|
 |
|
 |
While I have not read it myself, I understand that this book does a fair job teaching the application framework fundamentals you should know before you can accomplish your task. If you believe you already know the fundamentals, then Microsoft has a knowledge base article titled How to add references to a managed Visual C++ project that should serve as a refresher so you can solve your problem.
Here's wishing you good luck and Happy Fishing!!!
|
|
|
|
 |
|
 |
I can't read more than 2KB from text column with this wrapper. Other wrapper for .net works good on same database.
|
|
|
|
 |
|
 |
I cannot be certain of your comparison since I do not have a clue as to what you mean by your statement that the "Other wrapper for .net works good on same database." Your statement confuses me because the wrapper described in this article is based upon MFC and not Microsoft's managed code. My confusion is probably based upon my belief that it is important to distinguish the difference between MFC/C++ and managed code. In other words, code is not .NET just because it compiles using Visual Studio.NET. Is the ".NET" version to which you refer really managed code? In any case, more specific information would be useful before I can offer any meaningful insight. For example, what version of SQLite3 are you using with the ".NET" version that you consider to be working “good” [well] in your tests? Is the ".NET" version you are using access SQLite3 dynamically through a DLL? If you are using a DLL, does your ".NET" version use the same DLL as the one you are using to test this wrapper? Are you running your test on a desktop operating system or one of the WinCE/PPC/Mobile operating systems? Is your ".NET" version running on WinCE or Pocket PC? Meanwhile, I can only speculate about the problem you are experiencing. Since the wrapper described by DbSqlite.h only uses the MFC CString class along with LPCTSTR style pointers, it is unlikely that the 2KB limit you describe is directly related to the wrapper. If I needed to resolve this problem for my work, I would consider whether or not the problem I am experiencing resides with the version of SQLite3 being used for my tests.
-- modified at 8:47 Tuesday 30th January, 2007
|
|
|
|
 |
|
 |
Here is the example of database: http://www.volny.cz/hampl/pomocne/data_pokus.db3.
I can read only 2KB from column long_desc if I use this wrapper on pocketpc. I tried to compile dll from actual sqlite source, but with same issue. If I use other application for .net compact framework (version 2.0 SP1) with this database, it works good. This .net application uses own sqlite library. It's only test that this database is good and contains more than 2KB in this column and it's possible to read this data. I use WM5, VS 2005. I compile for WM5 platform.
|
|
|
|
 |
|
 |
LPTSTR pom = (LPTSTR)_sqlite3_column_text(m_stmt, pos_zero_indexed);
m_szText = pom;
works better than
m_szText.Format(_T("%s"), _sqlite3_column_text(m_stmt, pos_zero_indexed));
I get whole string now, not only 2KB of text. Is it feature or error of CString::Format?
|
|
|
|
 |
|
 |
Given that this solved your problem, I wonder if you have any characters embedded in the text that CString::Format would interpret as the end-of-string? Of course, this is only speculation based upon the fact that your use of pointers (LPTSTR) seemed to have solved the problem. This is even more confusing since I assume that _sqlite3_column_text would terminate the string at the first NULL.
Could you double check that the table I downloaded is the correct one from which to review the problem?
|
|
|
|
 |
|
 |
I downloaded your file and found your column long_desc in table cache_wpt. I used the SQLite Database Browser Version 1.2.1 found here to review your database. Unfortunately, I only see the test "<img src =" so I'm not certain what to make of this. Is it possible that the file I downloaded is not correct?
|
|
|
|
 |
|
 |
hi how can I make this working for a windows mobile 5.0 device?
|
|
|
|
 |
|
 |
Compile it using the Windows Mobile 5.0 SDK or use Visual Studio 2005 and hope that it works. If anything fails then you will gain experience learning how to resolve the problems.
That being said, there is no particular reason of which I am aware why this will not work. If it were my assignment, I would first make certain that SQL Lite for Windows CE will compile for Windows Mobile 5.0. If it will not, then your problems are somewhere else and not with the wrapper presented here.
Good Luck.
|
|
|
|
 |
|
|
 |