Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2003, 05:23 PM
Authorized User
 
Join Date: Jun 2003
Location: Livermore, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual Basic + Oracle

Does Visual Basic + Oracle + ADO work together well?

Or is ODBC the answer? I need to connect to an oracle database on a seperate machine from a Win2K server using Visual Basic.

Can someone point me in the right direction?

M
Reply With Quote
  #2 (permalink)  
Old July 5th, 2003, 08:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sparks, NV, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

VB and Oracle work well together. By using ADO, you are on the right track. You should install the oracle client (from Oracle), and choose the oracle Data Provider from Oracle, not from Microsoft. You should only use ODBC if there is a corporate mandate to do so. By adding the ODBC layer into the mix, you are slowing things down.

If you have never worked with Oracle, don't worry too much it is very similar to MS-SQL, but you will have to convert dates. I believe the command is to_date() but you will have to lookup the syntax.


John R Lick
JohnRLick@hotmail.com
Reply With Quote
  #3 (permalink)  
Old July 9th, 2003, 11:59 AM
Authorized User
 
Join Date: Jun 2003
Location: Livermore, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What would the connection string of the ADO Connection object look like?

Currently for MS-SQL:
Provider=SQLOLEDB.1
Persist Security Info=False
UserID=<USERID>
PWD=<PASS>
Initial Catalog=<DB_NAME>
Data Source=<SERVER>


With the Oracle 7 service, I have the ServiceName and UserName. But what would the Connection String look like?
Reply With Quote
  #4 (permalink)  
Old July 9th, 2003, 12:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sparks, NV, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

Here is how you can find one:

Run VB.
In the View menu select the Data View Window. This will display a window with a tree structure, (Data Links being the root.)
right click on the data links root item and select Add a data link.
This will display the Data Link Properties window.
Choose the oracle driver you are looking for (I perfer the one from oracle over the one from Microsoft).
Click the next button. This will take you to the connection tab.
Enter the appropriate information, and click test connection.
Click OK.
Now in the Data View window, right click on the new entry (probably DataLink1) and choose properties. Your connection string will appear in the Name Property.

You can use this as a base, and edit it as need be.


John R Lick
JohnRLick@hotmail.com
Reply With Quote
  #5 (permalink)  
Old July 9th, 2003, 12:59 PM
Authorized User
 
Join Date: Jun 2003
Location: Livermore, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This works good for databases on Oracle 8. But what do I need different for Oracle 7? Should I install the Oracle 7 Client as well? Are the Oracle ODBC Drivers different?
Reply With Quote
  #6 (permalink)  
Old July 9th, 2003, 02:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sparks, NV, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

I can't say if it would be different for Oracle 7, but I would expect it would be (at least the provider). What I have done in the past is have a setup program that calls up the same window, and store the connection string (without user & password) in the registry. That way your code doesn't have to care about the string, which will be created based on the oracle client that the client computer has.

I don't have access to the code to call up that window from VB, but if you are interested, please respond, and I will look it up when I get home from work. (Hopefully I still have that code.)



John R Lick
JohnRLick@hotmail.com
Reply With Quote
  #7 (permalink)  
Old August 7th, 2003, 11:52 AM
Registered User
 
Join Date: Jun 2003
Location: Kathmandu, , Nepal.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can I make Oracle connection with the help of batch file. I want my tables to be created in Oracle from a batch file.

Is there any way out ???
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic monika.vasvani VB Databases Basics 5 June 16th, 2014 10:01 AM
visual basic 6.0 flowertear Pro VB 6 3 June 28th, 2013 03:16 PM
visual basic khandangoll Beginning VB 6 1 October 6th, 2006 04:05 PM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Visual Basic 6.0 Danielvb VB How-To 1 June 9th, 2003 04:30 PM



All times are GMT -4. The time now is 02:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.