
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.