C
ca1358
When my code hit this line
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source = Trade_Limit"
error read couldnt find path "Counld find path
\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Trade_Limit
Since it is not a drive, is there someother snytax?
Dim adoCN As ADODB.Connection
Dim strSQL As String
Const DatabasePath As String = " \\Dtcnas-ilsp002\mandatory\Analysts -
Working Files\Carol\Demo\Trade_Limit"
Public Function DBVLookUp(End_of_year_incentive As String, _
As400 As String, _
A1 As String) As Variant
Dim adoRS As ADODB.Recordset
If adoCN Is Nothing Then SetUpConnection
Set adoRS = New ADODB.Recordset
strSQL = "SELECT * FROM " & End_of_year_incentive & _
" WHERE " & As400 & "=" & A1 & ";"
adoRS.Open strSQL, adoCN, adOpenForwardOnly, adLockReadOnly
If adoRS.BOF And adoRS.EOF Then
DBVLookUp = "Value not Found"
Else
DBVLookUp = adoRS.Fields(Package).Value
End If
adoRS.Close
End Function
Sub SetUpConnection()
On Error GoTo ErrHandler
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source =
Trade_Limit"
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation, "An error occurred"
End Sub
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source = Trade_Limit"
error read couldnt find path "Counld find path
\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\Trade_Limit
Since it is not a drive, is there someother snytax?
Dim adoCN As ADODB.Connection
Dim strSQL As String
Const DatabasePath As String = " \\Dtcnas-ilsp002\mandatory\Analysts -
Working Files\Carol\Demo\Trade_Limit"
Public Function DBVLookUp(End_of_year_incentive As String, _
As400 As String, _
A1 As String) As Variant
Dim adoRS As ADODB.Recordset
If adoCN Is Nothing Then SetUpConnection
Set adoRS = New ADODB.Recordset
strSQL = "SELECT * FROM " & End_of_year_incentive & _
" WHERE " & As400 & "=" & A1 & ";"
adoRS.Open strSQL, adoCN, adOpenForwardOnly, adLockReadOnly
If adoRS.BOF And adoRS.EOF Then
DBVLookUp = "Value not Found"
Else
DBVLookUp = adoRS.Fields(Package).Value
End If
adoRS.Close
End Function
Sub SetUpConnection()
On Error GoTo ErrHandler
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source =
Trade_Limit"
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation, "An error occurred"
End Sub