Hi Nomy!<br>
<br>
By coincidence, I was just doing this very same thing this week. <br>
<br>
Prerequisites:<br>
I have no references to ADO or DAO in my project. I have the MS Data-bound Grid 5.0 (SP3) component in the toolbox. I have a system DSN defined using the MS Oracle ODBC driver. I have the Oracle 8.0 client software installed (the MS Oracle ODBC driver needs it)<br>
<br>
I dropped a datacontrol onto my form, plus a VB5 Data-bound grid control. The datacontrol properties were set like:<br>
DefaultCursorType = 1-ODBCCursor<br>
DefaultType = 1-UseODBC<br>
RecordsetType = 1-Dynaset<br>
Connect = "ODBC;DSN=MyDSN;UID=MyUID;PWD=MyPwd;DBQ=MySID;"<br>
RecordSource = "select * from GLOB.REPORTWIZ_DEFS;"<br>
<br>
The gridcontrol just points at the datacontrol.<br>
<br>
There are a couple of tricks here. Tbe default cursor type has to be set to ODBCCursor otherwise you get a S1C00 error when you try and update a row. The DefaultType has to be set to UseODBC otherwise Microsoft's Jet drivers try and find an Access database file named MyUID.mdb. The RecordsetType has to be 1-Dynaset because Oracle's cursors only go forwards (not back & forth). The Connect string has to have the DBQ in it so that it can find the correct SID (otherwise you get an annoying signon screen). And lastly, the SQL you use has to have the owner's and tablenames in upper case, otherwise Oracle won't find them (you get a table-not-found error).<br>
<br>
Tbe connection string format that Oracle understands is (case-sensitive):<br>
DSN= ODBC Data Source Name<br>
UID= User ID or username<br>
PWD= Password (Specify PWD=; for an empty password)<br>
DBQ= Service Name<br>
DBA= Database attribute (W=write access, R=Read-only access)<br>
TLO= Translation option<br>
TLL= Translation Library name<br>
PFC= Prefetch count<br>
APA= Applications Attributes (T-Thread Safety Enabled)<br>
<br>
Chip H.<br>
<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.