Solved

DBGrid, Oracle, RDO, and Inserting Records

Posted on 1998-09-25
1
247 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

713 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