Results 1 to 8 of 8

Thread: [RESOLVED] Data Environment and Data Reports Error

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    15

    Resolved [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

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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

  3. #3
    Lively Member druid's Avatar
    Join Date
    Jun 2006
    Posts
    81

    Re: Data Environment and Data Reports Error

    check your connection string...
    indicate the password..
    e.g.
    VB Code:
    1. dim con As New ADODB.Connection
    2.  
    3. con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\INVWJ.mdb; Persist Security Info=False;Jet OLEDB:Database Password = wiljohn"

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    15

    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:
    1. Private Sub ProductsRpt_Click()
    2. 'Check for Products to Search For
    3. If (rsProducts.RecordCount = 0) Then
    4.     Information = "No Products"
    5.     frmNoInfo.Show
    6.     Exit Sub
    7. Else
    8.     Unload frmAction
    9.     Dim rpt As New ProductRpt
    10.     Set rpt.DataSource = rsProducts
    11.     With rpt.Sections("Detail")
    12.         .Controls("txtSku").DataField = "Sku"    'where quantity is a field in the recordset
    13.         .Controls("txtItem").DataField = "Item"
    14.         .Controls("txtPrice").DataField = "Price"
    15.         .Controls("txtPage").DataField = "Page"
    16.         .Controls("txtCode").DataField = "Code"
    17.     End With
    18.    
    19.     rpt.Show vbModal
    20.  
    21. 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.

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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?

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    15

    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:
    1. 'Connect to Products Database
    2. Set cnProducts = New ADODB.Connection
    3. cnProducts.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
    4. & "Data Source=" + Path
    5. cnProducts.Properties("Jet OLEDB:Database Password") = "optexx"
    6. cnProducts.Open
    7.  
    8. Set rsProducts = New ADODB.Recordset
    9. 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.

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    15

    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
  •  



Click Here to Expand Forum to Full Width