|
-
May 18th, 1999, 04:47 AM
#1
! SQL help with Update! (I think)
Here is my code, and I keep getting an error. I want to update an Access record that has more records than this. It reads them just fine when I change the SQL to a select statement.
CDatabase m_dbEdit;
CRecordset rsEdit;
CString strConnect;
strConnect ="ODBC;DSN=database;UID=;PW=;";
m_dbEdit.Open("",FALSE,FALSE,strConnect,FALSE);
CString strSQL;
strSQL = _T("UPDATE table SET Variable='edited' WHERE ID=1");
rsEdit.Open(CRecordset::snapshot, strSQL);
rsEdit.Close( );
m_dbEdit.Close( );
-
May 18th, 1999, 01:09 PM
#2
Re: ! SQL help with Update! (I think)
You don't need to use the CRecordset to do an update. Just do something like:
CString strSQL;
strSQL = _T("UPDATE table SET Variable='edited' WHERE ID=1");
myOpenDatabase.ExecuteSQL(strSQL);
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
|