Solved

inserting into oracle from vb

Posted on 2003-10-31
8
240 Views
Last Modified: 2010-05-18
hello experts,
Please help, i am having a problem in execting some queries of  Oracle

from vb.
actually i have connected with an Oracle 8 table via DSN. the

connection gets established and i can succefully execute Select query.

i can move into record set object also.
BUT i can execute Insert Into.. , Delete from..., Update... commands. i

think those queris which do not retun any recordset are not running i

was trying to run it using :-
      
      ;      
      ;
      set cmd=new adodb.command
      ;
      ;
      cmd.execute "Insert into login values('a','b')"
      msgbox("Recrod Inserted !!")

my program displyas the msgbox but when i enquire from Oracle, it does

not  show the newly inserted record.
Is there any need to set any particular properties of conn object or of

cmd object for this.
      
Please help and oblige
waiting..
Sandeep.
0
Comment
Question by:soodsandeep
8 Comments
 
LVL 5

Expert Comment

by:rajaamirapu
ID: 9662330
Are you using BeginTrans and ComitTrans in your code
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9663968
Have you ever considered that it might be time to maintain your many old open questions:

1 11/26/2002 100 Creating .COM file instead of .EXE file ...  Unlocked C Programming
2 01/29/2003 30 cOs.obj in c/c++?  Unlocked C Programming
3 04/24/2003 40 Hard disk management  Unlocked Hardware
4 01/07/2003 50 Finding the Capacity of ROM.  Unlocked C Programming
5 01/07/2003 25 Knowing the capactiy of ROM chip or L1, ...  Unlocked Hardware
6 02/07/2003 50 Polymorphism  Unlocked Programming Languages

Just curious,
Anthony
0
 

Author Comment

by:soodsandeep
ID: 9669399
hello Anthony,
thanks for reminding me.
i will soon evaluate and submit my rating for each answer.
take care.
Thanks.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:Deshin13
ID: 9670942
Try this out
Dim ModSec as String
Dim rsSec as ADODB.Recordset
Dim myConn1 as ADODB.Connection

Set myConn1 = New ADODB.Connection
'Then set myConn1 properties to whatever it is that you like
myConn1.Open

Set rsSec = New ADODB.Recordset
sModSec = "Insert into login values('a','b')"

rsSec.Open sModSec, myConn1, adOpenKeyset

' and that should do it
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9674205
Oracle is transaction based. As rajaamirapu mentioned above, you need to issue a "COMMIT" for your transactions to take effect. If you disconnect before you issue a "COMMIT", Oracle will assume the connection was broken due to a problem and automatically issue a "ROLLBACK" for you.



0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10457154
PAQed - no points refunded (of 100)

Computer101
E-E Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now