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

Database

 
GeneralRe: get the newly create record ID Pin
Tom Archer25-Aug-03 15:41
Tom Archer25-Aug-03 15:41 
GeneralRe: get the newly create record ID Pin
Jerome Conus25-Aug-03 19:02
Jerome Conus25-Aug-03 19:02 
GeneralRe: get the newly create record ID Pin
Tom Archer26-Aug-03 2:00
Tom Archer26-Aug-03 2:00 
QuestionOleDB or Sql? Pin
Alexandru Savescu19-Aug-03 22:28
Alexandru Savescu19-Aug-03 22:28 
AnswerRe: OleDB or Sql? Pin
Brad Sokol22-Aug-03 2:58
Brad Sokol22-Aug-03 2:58 
GeneralNO_DATA - no error information available Pin
bpchia19-Aug-03 20:10
bpchia19-Aug-03 20:10 
GeneralRe: NO_DATA - no error information available Pin
bpchia22-Aug-03 1:43
bpchia22-Aug-03 1:43 
Generalstumped Pin
Shotgun19-Aug-03 18:34
Shotgun19-Aug-03 18:34 
what is wrong here?
I'm using this function to add a new record, all is well, close the application, I get
The instruction at "0x044e2cc2" referenced memory at "0x00000020", memory could not be read.
If I add a second record right away will also error.

CDaoDatabase data;
CString SqlString;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString File; // = pApp->m_strDB;

File = "D:\\Apps\\MVS\\VC98\\MyProjects\\Homeplay\\Release\\ruthere.mdb";

char pszBuf[MAX_PATH];

GetDateFormat(LOCALE_USER_DEFAULT, NULL, NULL, "MMMM'.' dd',' yyyy", pszBuf, MAX_PATH);

// Build ODBC connection string
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,File);
TRY
{
// Open the database
data.Open(File);

// Allocate the recordset
CDaoRecordset recset( &data );

SqlString = "SELECT * "
"FROM Accounts"; // search all database

recset.Open(CRecordset::forwardOnly,SqlString, dbSeeChanges);

// make sure we can make changes and update
if (!recset.CanAppend() || !recset.CanUpdate( ))
{
AfxMessageBox("can't append to recordset");
return;
}

recset.AddNew();

recset.SetFieldValue("Nick", lpszUser);
recset.SetFieldValue("Pass", lpszPass);
recset.SetFieldValue("IP", lpszAddress);
recset.SetFieldValue("Authorize", "0");
recset.SetFieldValue("RegDate", pszBuf);

recset.Update();

recset.Close();

data.Close();
}



CATCH(CDBException, e)
{

// If a database exception occured, show error msg
AfxMessageBox("Database error: "+e->m_strError);
return;
}
END_CATCH;

any helps really appreciated.

shotgun
GeneralRe: stumped Pin
Rocky Moore19-Aug-03 22:58
Rocky Moore19-Aug-03 22:58 
GeneralRe: stumped Pin
Shotgun20-Aug-03 1:44
Shotgun20-Aug-03 1:44 
GeneralHelp with sql trigger Pin
Ista19-Aug-03 11:32
Ista19-Aug-03 11:32 
GeneralRe: Help with sql trigger Pin
Jason McBurney21-Aug-03 4:54
Jason McBurney21-Aug-03 4:54 
GeneralRe: Help with sql trigger Pin
Ista21-Aug-03 4:56
Ista21-Aug-03 4:56 
GeneralRe: Help with sql trigger Pin
Mike Dimmick22-Aug-03 4:04
Mike Dimmick22-Aug-03 4:04 
GeneralRe: Help with sql trigger Pin
Ista22-Aug-03 4:11
Ista22-Aug-03 4:11 
QuestionHELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
yyf19-Aug-03 9:20
yyf19-Aug-03 9:20 
AnswerRe: HELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
yyf19-Aug-03 10:25
yyf19-Aug-03 10:25 
GeneralRe: HELP!!! why it's so hard to insert a row to Database by ADO.NET? Pin
Tom Archer25-Aug-03 15:42
Tom Archer25-Aug-03 15:42 
Generalhelp with common ASP/SQL speed issues Pin
kaht19-Aug-03 7:20
kaht19-Aug-03 7:20 
GeneralRe: help with common ASP/SQL speed issues Pin
Jason McBurney21-Aug-03 4:57
Jason McBurney21-Aug-03 4:57 
GeneralRe: help with common ASP/SQL speed issues Pin
Mike Dimmick22-Aug-03 5:04
Mike Dimmick22-Aug-03 5:04 
GeneralRe: help with common ASP/SQL speed issues Pin
kaht25-Aug-03 3:03
kaht25-Aug-03 3:03 
GeneralJet OLEDB:Format Pin
Anthony988719-Aug-03 5:52
Anthony988719-Aug-03 5:52 
QuestionHow to make smaller ACCESS initial file ? Pin
vgrigor19-Aug-03 4:15
vgrigor19-Aug-03 4:15 
GeneralTransactions with Access Pin
Jerome Conus19-Aug-03 2:43
Jerome Conus19-Aug-03 2:43 

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.