brijendraydv
Member
Hi All,
Im using the below adodb query to connect to access db but in the last line rsdata.open im getting run time error 3001 and arguments are of wrong type,are out of acceptable range,or are in conflict with one another.
can any one help me on this .below is query.
Sub DbConnection()
Dim conn As ADODB.Connection
Dim sqlstr As String
'Dim rsData As Recordset
Set conn = New ADODB.Connection
If conn.State = 1 Then conn.Close
sqlstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ThisWorkbook.Path & "DeliveryDb.mdb;Persist Security Info=False"
conn.Open sqlstr
Dim rsData As New ADODB.Recordset
If rsData.State = 1 Then rsData.Close
rsData.Open " SELECT distinct region from Delivery ", oConn, adOpenStatic, adLockOptimistic
End Sub
Regards,
Im using the below adodb query to connect to access db but in the last line rsdata.open im getting run time error 3001 and arguments are of wrong type,are out of acceptable range,or are in conflict with one another.
can any one help me on this .below is query.
Sub DbConnection()
Dim conn As ADODB.Connection
Dim sqlstr As String
'Dim rsData As Recordset
Set conn = New ADODB.Connection
If conn.State = 1 Then conn.Close
sqlstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ThisWorkbook.Path & "DeliveryDb.mdb;Persist Security Info=False"
conn.Open sqlstr
Dim rsData As New ADODB.Recordset
If rsData.State = 1 Then rsData.Close
rsData.Open " SELECT distinct region from Delivery ", oConn, adOpenStatic, adLockOptimistic
End Sub
Regards,