Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > connecting to Oracle through Visual Basic


Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2005, 02:24 PM
VisualBrat VisualBrat is offline
Centurion
 
Join Date: Aug 2004
Location: Mogadore, Ohio
Posts: 102
Question connecting to Oracle through Visual Basic


Hi Everyone,
I have a general question for all of you that know about oracle. The company that I currently work for is migrating all data to oracle databases. We currently use a pretty messy hybrid of access, db2, and SQL. I have several applications that I have developed in Visual Basic 6.0 that need to grab data from these tables. I suppose when the conversion is complete I will have to change all of the connections in my programs. How can this be done? Can this be done?

Below is the typical code I use to retrieve data from my current databases, could someone please tell me what a equivalent would be for an Oracle database? With this sort of connection I have to use recordsets, is Oracle the same way?

Code:
pub_path = "\\WIND\APES\DATA\ACEPUBLICDATA.MDB" Set dbpubA = New ADODB.Connection dbpubA.CursorLocation = adUseClient dbpubA.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & pub_path & ";" & _ "jet oledb:database password=marioso;" & _ "Persist Security Info=False" dbpubA.Open SQLstmt = "" SQLstmt = "SELECT date_complt, site_number, site_name, site_address, " & _ "site_city, site_state, site_zip, devices, total FROM queue WHERE complt = True and posted = False" Dim RS_not_posted As ADODB.Recordset Set RS_not_posted = New ADODB.Recordset RS_not_posted.Open SQLstmt, dblocA, adOpenStatic, adLockOptimistic, adCmdText


Submission of any other helpful links etc would be very greatly appreciated!


Thanks!
__________________
"Never trust a computer you can't throw out the window." ~Steve Wozniak
"Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog. "
~Doug Larson

Last edited by HardCode; 02-11-2005 at 07:00 PM. Reason: added line break
Reply With Quote
  #2  
Old 02-11-2005, 02:42 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
Default

establishing connections and processing the recordsets are complished in essentially identical manners. There's a link to various database connection strings loacated in the Database FAQ

Just as there are differences in the SQL Dialect used by Access and SQL server, there are also differences in the SQL dialect used by Oracle. Typically, Oracle offers more options, and more "power" in SQL than does SQL Server or Access, especially when it comes to DDL (Database Design Language) SQL statements.

O'Reilly has a book: SQL In a Nutshell, by Kevin Kline and David Kline, that would probably be a very useful one for you to buy. It describes the SQL syntax for SQL Server, Orace, PostgreSQL, and MySQL side-by-side. Very useful when you using multiple databases.
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
  #3  
Old 02-11-2005, 02:47 PM
VisualBrat VisualBrat is offline
Centurion
 
Join Date: Aug 2004
Location: Mogadore, Ohio
Posts: 102
Default

Quote:
Originally Posted by loquin
establishing connections and processing the recordsets are complished in essentially identical manners. There's a link to various database connection strings loacated in the Database FAQ

Just as there are differences in the SQL Dialect used by Access and SQL server, there are also differences in the SQL dialect used by Oracle. Typically, Oracle offers more options, and more "power" in SQL than does SQL Server or Access, especially when it comes to DDL (Database Design Language) SQL statements.
Is there somewhere I can reference the different SQL dialect that is used by Oracle? Do the different dialects have different names? Where can I research the DDL SQL for Oracle?

Thanks so much!
__________________
"Never trust a computer you can't throw out the window." ~Steve Wozniak
"Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog. "
~Doug Larson
Reply With Quote
  #4  
Old 02-11-2005, 04:38 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
Default

Again, take a look at the Database FAQ. Post #13 may help.
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
  #5  
Old 02-11-2005, 05:14 PM
NEOLLE's Avatar
NEOLLE NEOLLE is offline
fully realized avatar

Super Moderator
* Expert *
 
Join Date: Jun 2004
Location: Davao Philippines
Posts: 2,295
Smile

Quote:
Originally Posted by VisualBrat
Is there somewhere I can reference the different SQL dialect that is used by Oracle? Do the different dialects have different names? Where can I research the DDL SQL for Oracle?

Thanks so much!
You can learn a lot from this site. Its all about Oracle SQL.
Introduction to Oracle SQL
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->