Update Oracle data using Data control and SQL? 
Author Message
 Update Oracle data using Data control and SQL?

Hi all,

I'm using VB3 and Sheridan's data bound grid. All I want to
do is create an updatable grid from a line of SQL.

I open the ODBC Oracle database using OpenDatabase and
then assign the Data control's Connect property to the
newly opened database

   Set OracleDB = OpenDatabase("")
   Data1.Connect = OracleDB
   TempSQL$ = "SELECT * FROM IO_REQ_MASTER"
   Data1.RecordSource = TempSQL$
   Data1.Refresh

No problem. Works like a charm.

The data bound grid's DataSource property is already set to
point to the Data control. Again, no problem. The grid populates
with the requested data from my simple SQL query.

The problem is, I have to use the DB_SQLPASSTHROUGH
option with the data control, and the resulting recordset is
NOT updatable.

It seems odd to have a Data control and data bound controls
but have them read-only when used with ODBC databases.
Can someone tell me this ain't true?

David M. Fornalsky
*** ClubWin Support Member - Chapter 11 ***

**********************************************************
*** Quick to judge, quick to anger, slow to understand ***
*** Ignorance and prejudice and fear walk hand in hand ***
**********************************************************
Lyrics from the song Witch Hunt, part 3 of Fear, by Rush from their release
entitled
Moving Pictures.



Sat, 13 Feb 1999 03:00:00 GMT  
 Update Oracle data using Data control and SQL?

Quote:

> Hi all,

> The problem is, I have to use the DB_SQLPASSTHROUGH
> option with the data control, and the resulting recordset is
> NOT updatable.

> It seems odd to have a Data control and data bound controls
> but have them read-only when used with ODBC databases.
> Can someone tell me this ain't true?

Never, EVER, *EVER* attempt to update Oracle through ODBC and Recordsets.
This is evil, and ODBC will punish you for it by being *VERY* slow.

Rule#1:  To update through ODBC, do a

DatabaseVariable.Execute "UPDATE x SET x = x WHERE x etc..."

I suspect that the reason your recordset is non-updatable under
DB_SQLPASSTHROUGH is because DB_SQLPASSTHROUGH does not cause ODBC to
fetch all sorts of interesting information on the table structure (which
is why your query actually returns short of when some place freezes over,
but that's another story...), and so ODBC "cannot" figure out how to do
updates.

So, the better option is to execute queries to do your updates... And an
even better (and *MUCH* more stable) option is not to use ODBC at all, but
that may not be possible in your case (ie, write/find a direct connection
DLL for Oracle).

--

Royalty free licence to read this message is freely available
to anyone except representatives or employees of Microsoft.
Microsoft may purchase non-exclusive licence to view this
message by paying the sum of $1,000,000 US to the author.  By
reading this message you have agreed to be bound by these terms.



Mon, 15 Feb 1999 03:00:00 GMT  
 Update Oracle data using Data control and SQL?



Quote:

>> Hi all,

>> The problem is, I have to use the DB_SQLPASSTHROUGH
>> option with the data control, and the resulting recordset is
>> NOT updatable.

>> It seems odd to have a Data control and data bound controls
>> but have them read-only when used with ODBC databases.
>> Can someone tell me this ain't true?

>Never, EVER, *EVER* attempt to update Oracle through ODBC and Recordsets.
>This is evil, and ODBC will punish you for it by being *VERY* slow.

Never is such a harsh word...Anyway go to www.oracle.com and take a look
at Oracle Objects for OLE. Modeled after DAO, but implmented with OLE
and OCI. Best of both worlds....
Quote:

>Rule#1:  To update through ODBC, do a

>DatabaseVariable.Execute "UPDATE x SET x = x WHERE x etc..."

>I suspect that the reason your recordset is non-updatable under
>DB_SQLPASSTHROUGH is because DB_SQLPASSTHROUGH does not cause ODBC to
>fetch all sorts of interesting information on the table structure (which
>is why your query actually returns short of when some place freezes over,
>but that's another story...), and so ODBC "cannot" figure out how to do
>updates.

>So, the better option is to execute queries to do your updates... And an
>even better (and *MUCH* more stable) option is not to use ODBC at all, but
>that may not be possible in your case (ie, write/find a direct connection
>DLL for Oracle).

>--

>Royalty free licence to read this message is freely available
>to anyone except representatives or employees of Microsoft.
>Microsoft may purchase non-exclusive licence to view this
>message by paying the sum of $1,000,000 US to the author.  By
>reading this message you have agreed to be bound by these terms.



Tue, 16 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DB not updated using dbcombo and oracle remote data control

2. ADO Data Controls + Using SQL instead of recordset.update

3. Updating data to a memo field using SQL UPDATE

4. Problem on SQL-Update Statement with a Data-Control in VB 5 and SQL Server 7.0

5. Using VB5 to import data to access without using the Data control

6. Using ADO Data Control on User Control as Data Source

7. Create User Control as Data Source Using ADO Data Control

8. Update data by remote data control

9. Problem on Update ODBC-Data thru a Data-Control in VB 5

10. Updating record by DATA control or by SQL

11. Accessing oracle using a data control

12. SQL <--> Data Control not updating

 

 
Powered by phpBB® Forum Software