Oracle-Visual Basic 5.0 Enterprise 
Author Message
 Oracle-Visual Basic 5.0 Enterprise

Don,
  I got your name and address from usenet.  I saw you are working with
the same platforms I am.  Orcacle 7.3 with VB5 Enterprise.  I can not
figure out how to send an insert or delete sql command to the database.
I am trying to use the following code.

Private Sub Form_Load()

Set db = OpenDatabase("gbldevel",False,False,

'strsql = "Grant basic_user to RBHATT"
strsql = "Delete from eas.eas_application_roles where user_id = 'ATEST'"

Set qd = db.CreateQueryDef("")
qd.Connect = "ODBC;DSN=gbldevel;UID=dbsecadmin;PWD=haiaats;"
qd.ReturnsRecords = False
qd.SQL = strsql
qd.Execute
End Sub

Notice one of the remmed out strsql is a grant command, this works
fine.  But the delete does nothing here, but works fine through sqlplus.

DO you know of another way to do this ANY HELP OR SAMPLE CODE WOULD BE
VERY HELPFULL.  I have presentation tomorrow, and I 'm going
to crash and burn if I don't figure it out.
            Anyways thanks for the help if you can.



Fri, 02 Feb 2001 03:00:00 GMT  
 Oracle-Visual Basic 5.0 Enterprise
I'm on Oracle 7.3 (Unix) and have been trying to talk to it using VB 5.0
Professional.  I'm trying to use native ODBC (2.0), and have not been
successful.

Anyway, a couple questions.
Can you do an unqualified delete (all rows)?
Can you retrieve rows from that same table?
Are you sure you're connecting as the same user in VB as in sqlplus?

Scott Basham



Fri, 02 Feb 2001 03:00:00 GMT  
 Oracle-Visual Basic 5.0 Enterprise
Hello,

I have succeeded in inserting and deleting records using the Connection's
'Execute' method as follows:

Set wsOracle = CreateWorkspace("OraWorkSpace", "scott", "tiger", dbUseODBC)
Workspaces.Append wsOracle
wsOracle.DefaultCursorDriver = dbUseODBCCursor
Set conOracle = wsOracle.OpenConnection("OraConnection", dbDriverNoPrompt,
False, "ODBC;DATABASE=orcl;DSN=Emp")
SQL = "DELETE FROM Emp WHERE Empno = 7901"
conOracle.Execute SQL$, dbExecDirect
SQL = "INSERT INTO Emp (Ename,Empno) VALUES ('REED',7901)"
conOracle.Execute SQL$, dbExecDirect

Hope this helps,

Don

Quote:

> Don,
>   I got your name and address from usenet.  I saw you are working with
> the same platforms I am.  Orcacle 7.3 with VB5 Enterprise.  I can not
> figure out how to send an insert or delete sql command to the database.
> I am trying to use the following code.

> Private Sub Form_Load()

> Set db = OpenDatabase("gbldevel",False,False,

> 'strsql = "Grant basic_user to RBHATT"
> strsql = "Delete from eas.eas_application_roles where user_id = 'ATEST'"

> Set qd = db.CreateQueryDef("")
> qd.Connect = "ODBC;DSN=gbldevel;UID=dbsecadmin;PWD=haiaats;"
> qd.ReturnsRecords = False
> qd.SQL = strsql
> qd.Execute
> End Sub

> Notice one of the remmed out strsql is a grant command, this works
> fine.  But the delete does nothing here, but works fine through sqlplus.

> DO you know of another way to do this ANY HELP OR SAMPLE CODE WOULD BE
> VERY HELPFULL.  I have presentation tomorrow, and I 'm going
> to crash and burn if I don't figure it out.
>             Anyways thanks for the help if you can.



Sat, 03 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Looking for differences between Visual Basic 5.0 enterprise and Visual Basic 5.0 Profesional

2. FS: MS Visual Basic 5.0 Enterprise Edition

3. Visual Basic 5.0 Enterprise

4. FS: MS Visual Basic 5.0 Enterprise Edition

5. Saving 5.0 enterprise as Visual Basic 3.0.

6. Visual Basic 5.0 Enterprise Edition Question

7. visual Basic 5.0 Enterprise

8. upgrading visual basic 5.0 to enterprise edition

9. visual basic 5.0 Enterprise Edition

10. Visual Basic 5.0 Enterprise CD

11. Visual Basic 5.0 Enterprise Pricing????

 

 
Powered by phpBB® Forum Software