Solved

DBGrid, Oracle, RDO, and Inserting Records

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
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…

708 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

16 Experts available now in Live!

Get 1:1 Help Now