|
-
Mar 27th, 2006, 08:08 AM
#1
Thread Starter
Hyperactive Member
VB DataReport
I have a wierd question, I have some reports that are generated based on input written in textboxes on a form....NOT from a database anywhere. Also, I need to run this on a windows 95 computer, that cannot run ADO. Is there a way to get the DataReport to display the data, without having to connect to a database? The way I have done this in the past, is to connect to a test MySQL database, that only has 1 record (for time...). After I connect to that test MySQL database, I can simply fill in the labels on the form with the following:
VB Code:
Me.Sections("Section1").Controls.Item("lblPartNumber").Caption = frmTyco32.txtPartNumber.Text & ""
Me.Sections("Section1").Controls.Item("lblPartRevision").Caption = frmTyco32.txtPartRevision.Text & ""
Me.Sections("Section1").Controls.Item("lblQuantity").Caption = frmTyco32.txtQuantity.Text & ""
Me.Sections("Section1").Controls.Item("lblLabelNumber").Caption = frmTyco32.intLabelCount & ""
I read to get ADO working on a windows 95 system, you had to install a DCOM patch...I've installed this DCOM patch, received no errors while installing...but when I run a report (that I know works on other systems), it gives me an error dealing with the ADO connections.
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
-
Mar 27th, 2006, 08:49 PM
#2
Frenzied Member
Re: VB DataReport
can you post the error number as well as the description
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 27th, 2006, 10:36 PM
#3
-
Mar 28th, 2006, 08:22 AM
#4
Thread Starter
Hyperactive Member
Re: VB DataReport
Code for this label:
VB Code:
Option Explicit
Private strsql As String 'SQL String.
Private cnMySQL As New ADODB.Connection 'New ADODB Connection.
Private oRS As New ADODB.Recordset 'New ADODB Recordset
Private Sub DataReport_Initialize()
Set cnMySQL = New ADODB.Connection 'We've declared it as an ADODB connection lets set it.
cnMySQL.CursorLocation = adUseClient 'We are Client.
cnMySQL.ConnectionString = "Provider=MSDASQL; DRIVER={MySQL ODBC 3.51 Driver}; SERVER=192.168.50.4; DATABASE=DBName; UID = Username; PASSWORD=Password; OPTION=3" 'Connection String.
cnMySQL.Open 'Opens Connection
strsql = "SELECT ID FROM tblTest "
'Connecting...
If oRS.State = adStateOpen Then oRS.Close
oRS.Open strsql, cnMySQL, adOpenForwardOnly
'Connection made.
Set Me.DataSource = oRS
Me.Sections("Section1").Controls.Item("lblPartNumber").Caption = frmFloor35.txtPartNumber.Text & ""
Me.Sections("Section1").Controls.Item("lblPartRevision").Caption = frmFloor35.txtPartRevision.Text & ""
Me.Sections("Section1").Controls.Item("lblOptionalInfo").Caption = frmFloor35.txtOptionalInfo.Text & ""
Me.Sections("Section1").Controls.Item("lblQuantity").Caption = frmFloor35.txtQuantity.Text & ""
Me.Sections("Section1").Controls.Item("lblTraceNumber").Caption = frmFloor35.intLabelCount & ""
End Sub
The error I am getting is:
Num: 3706
Desc: Provider cannot be found. It may not be properly installed.
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
-
Mar 28th, 2006, 09:19 PM
#5
Frenzied Member
Re: VB DataReport
so the error occurs with the cnMySQL.Open code right
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 28th, 2006, 09:25 PM
#6
Frenzied Member
Re: VB DataReport
try to check if this provider is available on your machine. You can check this using a UDL file.
To create a UDL file follow these steps
1. Create a text file on desktop. and rename it as filename.UDL
2. Now doubleclick and open it. Datalink properties dialog will open, Check for MSDASQL provider from the provider list.
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 29th, 2006, 08:12 AM
#7
Thread Starter
Hyperactive Member
Re: VB DataReport
When I ran that test, and opened the .UDL file...it gave an error saying it couldnt start: OLEDB32. I've tried manually installing and registering that .dll..and the same error comes up. I know that the MySQL connections exist...as I tried to install them today and it said I already had them installed.
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|