|
-
Nov 26th, 2006, 12:38 AM
#1
Thread Starter
New Member
[RESOLVED] Data Environment and Data Reports Error
I am creating a program using ADODB to connect to my database, I would like to be able to create reports using Data Environment with the information from the database, The database is password protected, and I am using an access 2000 database instead of the Visual Data Manager to connect to the database.
My problem is while I am setting up the properties in the Data Link Properties dialog box I select the database, enter the password, choose jet 4.0 as my ole db provider. when I click test Connection, i get an error that says:
"Test connection failed because of an error in initializing provider. Can't start your application. The workgroup information file is missing or opened exclusively by another user."
if i unset the password the connection works but i would prefer to have the database password protected any ideas on how to do this properly??
optexx
-
Nov 26th, 2006, 07:28 AM
#2
Re: Data Environment and Data Reports Error
You might want to consider a non-data bound solution...
http://www.vbforums.com/showthread.php?t=433765
-
Nov 26th, 2006, 10:20 AM
#3
Lively Member
Re: Data Environment and Data Reports Error
check your connection string...
indicate the password..
e.g.
VB Code:
dim con As New ADODB.Connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\INVWJ.mdb; Persist Security Info=False;Jet OLEDB:Database Password = wiljohn"
-
Nov 28th, 2006, 02:22 PM
#4
Thread Starter
New Member
Re: Data Environment and Data Reports Error
leinad31,
I followed the Link and put in the code i figured i needed, everything works great it reads the database into the report and so on, but when the code reaches.
rpt.show vbmodal
it brings up an error:
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
now i didn't use exactly what was in the example, because this particular report prints everything in that table of the database this is my code right now.
VB Code:
Private Sub ProductsRpt_Click()
'Check for Products to Search For
If (rsProducts.RecordCount = 0) Then
Information = "No Products"
frmNoInfo.Show
Exit Sub
Else
Unload frmAction
Dim rpt As New ProductRpt
Set rpt.DataSource = rsProducts
With rpt.Sections("Detail")
.Controls("txtSku").DataField = "Sku" 'where quantity is a field in the recordset
.Controls("txtItem").DataField = "Item"
.Controls("txtPrice").DataField = "Price"
.Controls("txtPage").DataField = "Page"
.Controls("txtCode").DataField = "Code"
End With
rpt.Show vbModal
End If
This should work should it not??
I have the connection and the recordset opened already in another code window. The other thing is my database is password protected would that cause this??? I know the connection is set up properly with the password cause i retrieve and write data to it when not using the reports.
Last edited by optexx; Nov 28th, 2006 at 02:34 PM.
-
Nov 28th, 2006, 11:52 PM
#5
Re: Data Environment and Data Reports Error
Try removing vbModal first, just run rpt.Show... if that fails, how is the recordset populated with records? With SQL? If so pls post SQL query. Are all the data report textboxes assigned/bound-to fields in the recordset?
-
Nov 29th, 2006, 11:21 AM
#6
Thread Starter
New Member
Re: Data Environment and Data Reports Error
I tried removing the vbmodal, same error. I didn't use sql.
Here is the code i used to connect to the database, and the recordset
VB Code:
'Connect to Products Database
Set cnProducts = New ADODB.Connection
cnProducts.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" + Path
cnProducts.Properties("Jet OLEDB:Database Password") = "optexx"
cnProducts.Open
Set rsProducts = New ADODB.Recordset
rsProducts.Open "Products", cnProducts, adOpenKeyset, adLockPessimistic, adCmdTable
The Datafield property is unbound on all the dataReport text boxes.
I also tried putting in a rpt.refresh before the rpt.show
but then it gives me the same error on the rpt.refresh, so it seems it doesnt like the rpt at all.
Im lost my next option is looking like i might have to make the report manually with a text file or something.
-
Nov 29th, 2006, 10:23 PM
#7
Re: Data Environment and Data Reports Error
Try creating a report with just the bare minimum (textboxes you will bind to Products table)... then build/expand on that report.
-
Nov 30th, 2006, 03:07 PM
#8
Thread Starter
New Member
Re: Data Environment and Data Reports Error
I did just that I created a new data Report used it and only put on the Unbound Textboxes. then linked them with the code that I posted earlier, the report worked!!!! perfect!!
Now I guess i will just add things one at a time and see what works and what doesn't I think everything should work fine now, it must have been because I created those original Data Reports when the data Environment was still there.
Oh well works now thanks a lot
RESOLVED
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
|