Solved

DBGrid, Oracle, RDO, and Inserting Records

Posted on 1998-09-25
1
241 Views
Last Modified: 2013-12-25
Hi. Need to know how to use the DBGrid to access data in an Oracle database.
My business need is to allow users the ability to review data that has been uploaded into the database into several tables. Once they fix any data related problems, I need to call a stored procedure to process the data and write out a delimited file that another program will read.

I need this by next week and dont have the time to learn everything I need to know about VB5 between now and then. Figured I would use the DBGrid control that comes with VB5 Enterprise Edition but it seems flakey. I used the Forms Wizard to attach to the database and pick the columns I need from a table. When I run the program, no data appears. Havent been able to figure out how to set programatically.
When I accidently!! got it to sortof work once, it blew chunks when I tried to insert a record.

Any code samples would be VERY appreciative.
Have figured out how to use RDO to get a result set but not how to get the grid to use it or how to use it to update/insert data.

I dont know how hard this question really is. My guess was that someone that knew VB pretty good would be able to do this in a weekend but the 3 VB programmers we have here say they dont know anything about RDO and are terrified of oracle.

Thanks,

clay@his.com
cordell.c.davidson@jci.com
0
Comment
Question by:davidson1
1 Comment
 

Accepted Solution

by:
mskannan earned 150 total points
ID: 1496430
Hi Davidson,
Just try this simple one.
First goto Project---> components---> and choose both
Microsoft DBGrid Control and
Microsoft Remote Data Control
and choose apply and OK.

Now in the form, open a new form and insert both the above two controls and change the properties as below.

DBGrid1 Control:
AllowAddNew = true
AllowUpdate = true
DataSource = MSRDC1

MSRDC1 Control:
Connect = "DSN=temp;UID=sa;PWD=;DATABASE='MIS';"
 'mis is the database name
CursorDriver=rdUseOdbc
Datasourcename=temp 'temp is the dsn name
ReadOnly=False
Resultsettype=rdOpenKeyset
sql="Select * from emp" ' emp is the table name
visible = false

Save it and run this simple one.

If you have any doubts in the above code contact me at
mskannan@sp.edu.sg

mskannan

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

912 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