- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi, i am currently using an oracle db. And i need to make my vb6 application to get its info from this oracle db before it goes on to view the report from the crystal report. But i am not saure as to how to connect from my vb6 applicaition to the oracle db. Below is the codes of my application. Can somebody pls let mi noe how to go abt doing it, if possibel can give mi the codes.. Pls reply ASAP. Tks alot...
MY APPLICATION CODE:
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Private Sub form_load()
dlgFileSelect.Filter = "Reports(*.rpt)|*.rpt|Acro
dlgFileSelect.ShowOpen
If dlgFileSelect.FileName <> "" Then
strRptPath = dlgFileSelect.FileName
Set Report = Appl.OpenReport(strRptPath
CRViewer91.ReportSource = Report
CRViewer91.Refresh
CRViewer91.ViewReport
Command1.Visible = False
Dim expt As CRAXDRT.ExportOptions
Set expt = Report.ExportOptions
expt.DestinationType = crEDTDiskFile
expt.DiskFileName = strRptPath & ".pdf"
expt.FormatType = crEFTPortableDocFormat
expt.PDFExportAllPages = True
Report.Export (False)
MsgBox "Exporting of report done"
End
Else
MsgBox "Please select a Report"
End If
End Sub
Private Sub Form_Resize()
With CRViewer91
.Width = Me.ScaleWidth
.Height = Me.ScaleHeight
End With
End Sub
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: renurajPosted on 2003-09-29 at 04:23:35ID: 9450485
Find the code below .. how to connect to Oracle Database:
--- Code starts here...
Public vUser As String
Public vPasswd As String
Public vDatabase As String
Public connString As String
Public dbConn As New ADODB.Connection
vUser = txtUsername
vPasswd = txtPassword
vDatabase = lstDatabase.Text
Provider = "OraOLEDB.Oracle.1"
SecurityInfo = True
connString = "Provider=" & Provider & ";Password=" & vPasswd & ";Security I
nfo=" & SecurityInfo & ";User ID=" & vUser & ";Data Source=" & vDatabase
dbConn.ConnectionString = connString
dbConn.Open
Set rs = dbConn.Execute("select sysdate from dual")
MsgBox "Connected at " & rs!sysdate
--- Code ends here...
Let me know, if you find any difficulties...
All the best,
Raj