Kamis, 01 Maret 2012

[MS_AccessPros] Data Provider cannot be initialized...

 

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

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar