Click here to Skip to main content
16,006,373 members
Home / Discussions / Database
   

Database

 
GeneralCreating Database Programmitically - Urgent plz Pin
Dhanush25-May-01 2:43
professionalDhanush25-May-01 2:43 
GeneralRe: Creating Database Programmitically - Urgent plz Pin
30-May-01 5:01
suss30-May-01 5:01 
Generalcannot use _RecordsetPtr when importing msado15.dl Pin
Bartek25-May-01 2:07
Bartek25-May-01 2:07 
GeneralRe: cannot use _RecordsetPtr when importing msado15.dl Pin
Robert Dickenson26-May-01 16:51
Robert Dickenson26-May-01 16:51 
Generalreal ****er of an SQL query Pin
Nick Blumhardt24-May-01 20:45
Nick Blumhardt24-May-01 20:45 
GeneralTEMP TABLES!!!! :) :)) Pin
Nick Blumhardt24-May-01 21:17
Nick Blumhardt24-May-01 21:17 
GeneralRe: real ****er of an SQL query Pin
24-May-01 21:34
suss24-May-01 21:34 
GeneralADO - AddNew and Update Pin
jerry0davis24-May-01 0:10
jerry0davis24-May-01 0:10 
I'm very new to ADO... The problem I have is I can easily read an Access2000 database, but I can't write to it. I do an AddNew, then update the bound classes memver variables, and then call Update(). As soon as I call update, I get a crash. Please anyone got any ideas why? Here is the code it use...
<br />
    _bstr_t strCnn(DSN_CONNECT_STRING);<br />
<br />
    // Define Other Variables.<br />
    HRESULT  hr = S_OK;<br />
    IADORecordBinding *picRsPatient = NULL;  // Interface Pointer declared.<br />
	<br />
    try<br />
    {<br />
	// open connection and record set<br />
        TESTHR(m_pConnection.CreateInstance(__uuidof(Connection)));<br />
        m_pConnection->Open(strCnn,"","",adConnectUnspecified);<br />
<br />
	TESTHR(m_pRstPatient.CreateInstance(__uuidof(Recordset)));<br />
        m_pRstPatient->Open("Patient", <br />
            _variant_t((IDispatch *)m_pConnection,true), adOpenKeyset,<br />
            adLockOptimistic, adCmdTable);<br />
<br />
	// Open an IADORecordBinding interface pointer which we'll <br />
        // use for Binding Recordset to a class.<br />
        TESTHR(m_pRstPatient->QueryInterface(<br />
            __uuidof(IADORecordBinding),(LPVOID*)&picRsPatient));<br />
        //Bind the Recordset to a C++ Class here.<br />
        TESTHR(picRsPatient->BindToRecordset(&m_rsPatient));<br />
<br />
	}<br />
<br />
    catch(_com_error &e)<br />
    {<br />
        // Notify the user of errors if any.<br />
        // Pass a connection pointer accessed from the Connection.<br />
        PrintProviderError(m_pConnection);<br />
        PrintComError(e);<br />
    }<br />
<br />
	m_pRstPatient->AddNew();<br />
	strcpy(m_rsPatient.m_szPatientName, "James bond");<br />
	strcpy(m_rsPatient.m_szPatientNumber, "007");<br />
	m_pRstPatient->Update();<br />
<br />
	if(m_pRstPatient)<br />
		m_pRstPatient->Close();<br />
	if(m_pConnection)<br />
		m_pConnection->Close();<br />


Thanks
GeneralRe: ADO - AddNew and Update Pin
Aky13-Jun-01 1:58
Aky13-Jun-01 1:58 
GeneralRe: ADO - AddNew and Update Pin
jerry0davis13-Jun-01 2:08
jerry0davis13-Jun-01 2:08 
Questionhow to make select fast use ODBC Pin
bighare22-May-01 0:15
bighare22-May-01 0:15 
AnswerRe: how to make select fast use ODBC Pin
l a u r e n22-May-01 23:42
l a u r e n22-May-01 23:42 
GeneralRe: how to make select fast use ODBC Pin
bighare23-May-01 1:36
bighare23-May-01 1:36 
GeneralRe: how to make select fast use ODBC Pin
Tomasz Sowinski23-May-01 1:53
Tomasz Sowinski23-May-01 1:53 
GeneralRe: how to make select fast use ODBC Pin
bighare23-May-01 2:17
bighare23-May-01 2:17 
GeneralRe: how to make select fast use ODBC Pin
Tomasz Sowinski23-May-01 2:36
Tomasz Sowinski23-May-01 2:36 
GeneralRe: how to make select fast use ODBC Pin
bighare23-May-01 2:47
bighare23-May-01 2:47 
GeneralRe: how to make select fast use ODBC Pin
bighare24-May-01 15:39
bighare24-May-01 15:39 
GeneralADO Parameters Pin
Richard Hudson21-May-01 22:44
Richard Hudson21-May-01 22:44 
GeneralRe: ADO Parameters Pin
28-May-01 1:44
suss28-May-01 1:44 
GeneralADO Parameters Pin
Richard Hudson21-May-01 22:44
Richard Hudson21-May-01 22:44 
GeneralSQL Query for last rows Pin
21-May-01 4:00
suss21-May-01 4:00 
GeneralRe: SQL Query for last rows Pin
l a u r e n21-May-01 4:04
l a u r e n21-May-01 4:04 
GeneralRe: SQL Query for last rows Pin
21-May-01 4:18
suss21-May-01 4:18 
GeneralRe: SQL Query for last rows Pin
l a u r e n21-May-01 11:50
l a u r e n21-May-01 11:50 

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.