Kamis, 01 Maret 2012

Re: [MS_AccessPros] Data Provider cannot be initialized...

 

Art-

Start by changing your ADO recordset to DAO. Form recordsets in a non-ADP app are DAO. I'm not even sure you can assign an ADO recordset to a form without strange results.

John Viescas 
(32,000 feet somewhere over Ohio)

Sent From T-Mobile

-------- Original message --------
Subject: [MS_AccessPros] Data Provider cannot be initialized...
From: Art <dbalorenzini@yahoo.com>
To: MS_Access_Professionals@yahoogroups.com
CC:

I am having an issue with two of my forms, the first form is frmProjectList which is based on a split form. It's record source is as follows:

SELECT tblProject.ProjectID, tblProject.[Project Number], tblFundingSource.FundingSourceName, tblProject.SortOrder, tblProject.FundingSourceAmount, tblProject.FundingStartDate, tblProject.FundingEndDate, tblProject.RetiredDate, tblProject.Notes, tblProject.Active
FROM tblFundingSource INNER JOIN tblProject ON tblFundingSource.FundingSourceID = tblProject.FundingSourceID
ORDER BY tblProject.SortOrder;

It also has an action link on it with the source of:
=IIf(IsNull([ProjectID]),"(New)","Open")

This opens a form called frmProjectDetails. I have the following code in my form which I use for navigation purposes:

Option Compare Database
Option Explicit
  Dim rst As ADODB.Recordset

Private Sub Form_Load()
   Set rst = New ADODB.Recordset
    rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenKeyset
    rst.CursorLocation = adUseClient
    rst.LockType = adLockOptimistic
    rst.Open "Select * from tblProject", Options:=adCmdText
    Set Me.Recordset = rst

If Not Me.NewRecord Then
    Me.Caption = Nz("Project Number: " & Me.[Project Number], "No Project Listed")
   
End If

Private Sub Form_Unload(Cancel As Integer)
    rst.Close
    Set rst = Nothing
End Sub

When I use my link to open the detail from  get Data Provider cannot be initialized error. I click Ok on the error and it open the frmPrjectDetails appropriatly. I need to correct this error:

THanks

Art Lorenzini
Sioux Falls

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar