Click here to Skip to main content
15,914,070 members
Home / Discussions / Database
   

Database

 
GeneralRe: Recursive Common Table Expressions Pin
Jörgen Andersson21-Feb-16 7:31
professionalJörgen Andersson21-Feb-16 7:31 
GeneralRe: Recursive Common Table Expressions Pin
CHill6021-Feb-16 8:04
mveCHill6021-Feb-16 8:04 
GeneralRe: Recursive Common Table Expressions Pin
Jörgen Andersson21-Feb-16 21:34
professionalJörgen Andersson21-Feb-16 21:34 
GeneralRe: Recursive Common Table Expressions Pin
CHill6021-Feb-16 22:19
mveCHill6021-Feb-16 22:19 
GeneralRe: Recursive Common Table Expressions Pin
Jörgen Andersson21-Feb-16 22:30
professionalJörgen Andersson21-Feb-16 22:30 
GeneralRe: Recursive Common Table Expressions Pin
Amr.Mohammad8722-Feb-16 10:28
Amr.Mohammad8722-Feb-16 10:28 
QuestionEntity Pin
mohsen47319-Feb-16 21:03
mohsen47319-Feb-16 21:03 
QuestionSQLPrepare error: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. Pin
Member 1233569519-Feb-16 17:48
Member 1233569519-Feb-16 17:48 
Hi All,

I am trying to write a prototype to insert values into a Ms-Access table by using ODBC driver and ACE database engine in VC++.
software used: Ms-Access 2010(32 bit), ACE database engine(32 bit), Windows 8(64 bit), VC++ 2013 and the application is in 32 bit.

code snippet:
iRetCode = SQLAllocHandle(SQL_HANDLE_STMT, m_hdbc, &m_hstmt);
if (iRetCode != SQL_SUCCESS && iRetCode != SQL_SUCCESS_WITH_INFO)
return false;
iRetCode = SQLPrepare(m_hstmt, (SQLCHAR*)&m_sSqlStatement, SQL_NTS);
if ((iRetCode != SQL_SUCCESS && iRetCode != SQL_SUCCESS_WITH_INFO) || iRetCode != SQL_INVALID_HANDLE)
{
n = 1;
CString strMsg;
while ((retcode2 = SQLGetDiagRec(SQL_HANDLE_STMT, m_hstmt, n, SqlState, &NativeError, Msg, sizeof(Msg), &MsgLen)) != SQL_NO_DATA)
{
strMsg = Msg;
AfxMessageBox(strMsg);
n++;
}
SQLFreeHandle(SQL_HANDLE_STMT, m_hstmt);
return false;
}

later I will bind the values to the m_sSqlStatement by using SQLBindParameter(m_hstmt,,,,,,,,,)

I am using the database driver as "Driver={Microsoft Access Driver (*.mdb, *.accdb)}"
input m_sSqlStatement = "INSERT INTO LaserExportTest VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

and the SQLPrepare error: "[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'."

I tried to run the above Insert statement in Ms-Access 2010 database separately and it is able to insert values successfully. Please let me know the suggestions on insert statement that will be used in SQLPrepare statement.

Thanks in advance,
Chowdam.
Questionhow to set/retrieve data directory and index directory of a table of mysql database Pin
CanadaProgrammer16-Feb-16 23:37
CanadaProgrammer16-Feb-16 23:37 
AnswerRe: how to set/retrieve data directory and index directory of a table of mysql database Pin
Richard MacCutchan16-Feb-16 23:54
mveRichard MacCutchan16-Feb-16 23:54 
QuestionHow to setup a local database for my application Pin
Theo Buys16-Feb-16 22:55
Theo Buys16-Feb-16 22:55 
AnswerRe: How to setup a local database for my application Pin
Richard MacCutchan16-Feb-16 23:52
mveRichard MacCutchan16-Feb-16 23:52 
GeneralRe: How to setup a local database for my application Pin
Theo Buys17-Feb-16 5:31
Theo Buys17-Feb-16 5:31 
GeneralRe: How to setup a local database for my application Pin
Richard MacCutchan17-Feb-16 5:42
mveRichard MacCutchan17-Feb-16 5:42 
GeneralRe: How to setup a local database for my application Pin
Theo Buys17-Feb-16 7:24
Theo Buys17-Feb-16 7:24 
QuestionWhat is wrong with my query? Pin
samflex11-Feb-16 4:57
samflex11-Feb-16 4:57 
AnswerRe: What is wrong with my query? Pin
Richard Deeming11-Feb-16 8:52
mveRichard Deeming11-Feb-16 8:52 
AnswerRe: What is wrong with my query? Pin
ZurdoDev11-Feb-16 9:19
professionalZurdoDev11-Feb-16 9:19 
Questiondata warehouse for hospital Pin
mohammed.alchalabee9-Feb-16 3:11
mohammed.alchalabee9-Feb-16 3:11 
AnswerRe: data warehouse for hospital Pin
Eddy Vluggen9-Feb-16 3:16
professionalEddy Vluggen9-Feb-16 3:16 
GeneralRe: data warehouse for hospital Pin
CHill609-Feb-16 13:21
mveCHill609-Feb-16 13:21 
GeneralRe: data warehouse for hospital Pin
jschell12-Feb-16 12:38
jschell12-Feb-16 12:38 
GeneralRe: data warehouse for hospital Pin
Eddy Vluggen12-Feb-16 14:17
professionalEddy Vluggen12-Feb-16 14:17 
GeneralRe: data warehouse for hospital Pin
jschell19-Feb-16 13:03
jschell19-Feb-16 13:03 
AnswerRe: data warehouse for hospital Pin
ZurdoDev9-Feb-16 15:22
professionalZurdoDev9-Feb-16 15:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.