Click here to Skip to main content
15,898,222 members
Home / Discussions / Database
   

Database

 
GeneralCreate System Database form C# using ADOX Pin
ulrich_v28-Jul-04 0:37
ulrich_v28-Jul-04 0:37 
GeneralNeed help!!! Pin
yanh10027-Jul-04 14:12
yanh10027-Jul-04 14:12 
QuestionCan I call OLEDB and ADO from the same app? Pin
CherezZaboro27-Jul-04 8:34
CherezZaboro27-Jul-04 8:34 
GeneralADO Connection Failure...HELP!!!!! Pin
girl_lash26-Jul-04 21:27
girl_lash26-Jul-04 21:27 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
Bill Dean27-Jul-04 4:45
Bill Dean27-Jul-04 4:45 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
girl_lash27-Jul-04 14:22
girl_lash27-Jul-04 14:22 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
Bill Dean28-Jul-04 9:49
Bill Dean28-Jul-04 9:49 
GeneralUsing MDB database with OLEDB/ATL/MFC (from SQL Server) Pin
Gian26-Jul-04 2:15
Gian26-Jul-04 2:15 
I'm programming a little server application in MFC 7.1 + OLEDB that read from a database. I'm using a SQL Server DB (extactly the MSDE version) and all works good, but now i need to store the data in an Access 2000 file, so i've changed the connection parameters like this:

<br />
<br />
CDBPropSet dbinit(DBPROPSET_DBINIT);<br />
HRESULT	hr;<br />
<br />
dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("Admin"));<br />
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR(""));<br />
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("C:\\Gestu.mdb"));<br />
dbinit.AddProperty(DBPROP_INIT_MODE, (long)DB_MODE_READWRITE/*(long)16*/);<br />
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_NOPROMPT/*(short)4*/);<br />
dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR(""));<br />
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033);<br />
  <br />
hr = m_DataSource.Open(_T("Microsoft.Jet.OLEDB.4.0"), &dbinit);<br />
if (FAILED(hr))<br />
  return false;<br />
<br />
hr = m_session.Open(m_DataSource);<br />
if (FAILED(hr))<br />
   return false;<br />
<br />
return true;<br />
<br />
}<br />
<br />


the program logins correctly. but when i try to execute a SELECT statement or other accessor operations and execute them it have an error DB_E_ERRORSINCOMMAND.

a sample operation is:

<br />
CCommand<CDynamicAccessor> DynamicAccessor;<br />
<br />
CDBPropSet	propset(DBPROPSET_ROWSET);<br />
	propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);<br />
propset.AddProperty(DBPROP_IRowsetScroll, true);<br />
propset.AddProperty(DBPROP_IRowsetChange, true);<br />
propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE);<br />
<br />
DBROWCOUNT rows;<br />
CString sql; sql.Format("SELECT * FROM Users WHERE nickname = '%s';", strNickname);<br />
HRESULT		hr;<br />
hr = DynamicAccessor.Open(m_session, sql, &propset, &rows);<br />
if (FAILED(hr))<br />
    return false;<br />


The same code here works perfectly with the SQL Server connection. Is there some parameters to modify?

Thanks
GeneralWindows-only authentication not working Pin
sid98dha26-Jul-04 0:40
susssid98dha26-Jul-04 0:40 
GeneralRe: Windows-only authentication not working Pin
Mike Dimmick26-Jul-04 5:29
Mike Dimmick26-Jul-04 5:29 
GeneralCurious about a query Pin
brdavid25-Jul-04 15:12
brdavid25-Jul-04 15:12 
GeneralRe: Curious about a query Pin
Grimolfr26-Jul-04 4:26
Grimolfr26-Jul-04 4:26 
GeneralRe: Curious about a query Pin
brdavid26-Jul-04 6:04
brdavid26-Jul-04 6:04 
GeneralRe: Curious about a query Pin
Michael Potter26-Jul-04 10:36
Michael Potter26-Jul-04 10:36 
GeneralRe: Curious about a query Pin
Grimolfr26-Jul-04 11:28
Grimolfr26-Jul-04 11:28 
GeneralHOW: format date field in sql Pin
JabraJabra25-Jul-04 13:16
JabraJabra25-Jul-04 13:16 
GeneralRe: HOW: format date field in sql Pin
darkbyte29-Jul-04 1:37
darkbyte29-Jul-04 1:37 
GeneralData type Pin
Peter Mayhew25-Jul-04 4:42
Peter Mayhew25-Jul-04 4:42 
GeneralRe: Data type Pin
Peter Mayhew27-Jul-04 9:24
Peter Mayhew27-Jul-04 9:24 
GeneralDEADLOCK PROBLEMc (ASAP) Pin
Anonymous24-Jul-04 23:26
Anonymous24-Jul-04 23:26 
GeneralRe: DEADLOCK PROBLEMc (ASAP) Pin
Michael Potter26-Jul-04 11:17
Michael Potter26-Jul-04 11:17 
General@@IDENTITY detection with ADO Pin
darkbyte24-Jul-04 10:49
darkbyte24-Jul-04 10:49 
GeneralRe: @@IDENTITY detection with ADO Pin
mav.northwind24-Jul-04 23:49
mav.northwind24-Jul-04 23:49 
Generalweekly,monthly and yearly report Pin
placement24-Jul-04 0:59
placement24-Jul-04 0:59 
GeneralUrgent! Need Help with SQL Statement Pin
bunnymaniac23-Jul-04 15:40
bunnymaniac23-Jul-04 15:40 

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.