Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |