ChuckRush
asked on
Set LocalConnection = CurrentProject.AccessConnection syntax for Access 2000
I have developed an application in Access 2002 the uses the following systax.
Dim LocalConnection As ADODB.Connection
Set LocalConnection = CurrentProject.AccessConne ction
I now find I have to include some PCs running v 2000. Can you tell me what the correct sytax is. The syntax above is not supported in ADO 2.1 ot extentions 2.7 which are included on the PcS.
Alternatively, can I load the more current version of the libraries and if so where do i get them.
Thanks
Dim LocalConnection As ADODB.Connection
Set LocalConnection = CurrentProject.AccessConne
I now find I have to include some PCs running v 2000. Can you tell me what the correct sytax is. The syntax above is not supported in ADO 2.1 ot extentions 2.7 which are included on the PcS.
Alternatively, can I load the more current version of the libraries and if so where do i get them.
Thanks
ASKER
OK so there is another problem. The OS is XP sp1 and v2.8 does not install. I user v2.7 sp1 but it does not seem to support the syntax either.
>> The OS is XP sp1 and v2.8 does not install
I don't recall that happening... Do you have the rights to install (Admin rights?)
Can you post your full code please.
Dave
I don't recall that happening... Do you have the rights to install (Admin rights?)
Can you post your full code please.
Dave
ASKER
Private Sub PrintWholeRecord_Click()
On Error GoTo Err_PrintWholeRecord_Click
Dim stDocName As String
'Check Report Print Flag
Dim rsHR As New ADODB.Recordset
Dim strSQL As String
Dim strWork As String
Dim LocalConnection As ADODB.Connection
Set LocalConnection = CurrentProject.AccessConne ction
rsHR.CursorType = adOpenDynamic
rsHR.LockType = adLockOptimistic
strSQL = "Select * from StatusTable"
rsHR.Open strSQL, LocalConnection, , , adcmdtxt
rsHR.Find "ID = " & Str(1)
rsHR("HR ID") = Me.ID
rsHR.Update
rsHR.Close
Set rsHR = Nothing
stDocName = "Screen Print"
DoCmd.OpenReport stDocName, acPreview
Err_PrintWholeRecord_Click :
MsgBox Err.Description
Resume Exit_PrintWholeRecord_Clic k
End Sub
On Error GoTo Err_PrintWholeRecord_Click
Dim stDocName As String
'Check Report Print Flag
Dim rsHR As New ADODB.Recordset
Dim strSQL As String
Dim strWork As String
Dim LocalConnection As ADODB.Connection
Set LocalConnection = CurrentProject.AccessConne
rsHR.CursorType = adOpenDynamic
rsHR.LockType = adLockOptimistic
strSQL = "Select * from StatusTable"
rsHR.Open strSQL, LocalConnection, , , adcmdtxt
rsHR.Find "ID = " & Str(1)
rsHR("HR ID") = Me.ID
rsHR.Update
rsHR.Close
Set rsHR = Nothing
stDocName = "Screen Print"
DoCmd.OpenReport stDocName, acPreview
Err_PrintWholeRecord_Click
MsgBox Err.Description
Resume Exit_PrintWholeRecord_Clic
End Sub
Can't see why this wont work
Private Sub PrintWholeRecord_Click()
On Error GoTo Err_PrintWholeRecord_Click
Dim stDocName As String
'Check Report Print Flag
Dim rsHR As New ADODB.Recordset
Dim strSQL As String
Dim strWork As String
rsHR.CursorType = adOpenDynamic
rsHR.LockType = adLockOptimistic
strSQL = "Select * from StatusTable"
rsHR.Open strSQL, CurrentProject.AccessConne ction, , , adcmdtxt
rsHR.Find "ID = " & Str(1)
rsHR("HR ID") = Me.ID
rsHR.Update
rsHR.Close
Set rsHR = Nothing
stDocName = "Screen Print"
DoCmd.OpenReport stDocName, acPreview
Err_PrintWholeRecord_Click :
MsgBox Err.Description
Resume Exit_PrintWholeRecord_Clic k
End Sub
Private Sub PrintWholeRecord_Click()
On Error GoTo Err_PrintWholeRecord_Click
Dim stDocName As String
'Check Report Print Flag
Dim rsHR As New ADODB.Recordset
Dim strSQL As String
Dim strWork As String
rsHR.CursorType = adOpenDynamic
rsHR.LockType = adLockOptimistic
strSQL = "Select * from StatusTable"
rsHR.Open strSQL, CurrentProject.AccessConne
rsHR.Find "ID = " & Str(1)
rsHR("HR ID") = Me.ID
rsHR.Update
rsHR.Close
Set rsHR = Nothing
stDocName = "Screen Print"
DoCmd.OpenReport stDocName, acPreview
Err_PrintWholeRecord_Click
MsgBox Err.Description
Resume Exit_PrintWholeRecord_Clic
End Sub
ASKER
I works great under xp sp2 and 2.8 ado but it reports that property is not supported uner xp sp1 and 2.7
I only have Access 97 at work, but I'm sure this
CurrentProject.AccessConne ction
should be either
CurrentProject.Connection
or
CurrentProject.ActiveConne ction
Can't recall from memory sorry..
Dave
CurrentProject.AccessConne
should be either
CurrentProject.Connection
or
CurrentProject.ActiveConne
Can't recall from memory sorry..
Dave
Is there a procitcal reason why you are not using the
CurrentProject.Connection object?
I have ADO 2.8, and find no reference to CurrentProject.ActiveConne ction
AW
CurrentProject.Connection object?
I have ADO 2.8, and find no reference to CurrentProject.ActiveConne
AW
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.microsoft.com/downloads/details.aspx?FamilyID=78cac895-efc2-4f8e-a9e0-3a1afbd5922e&DisplayLang=en
Dave