-
February 20th, 2004, 03:17 AM
#1
Runtime Error 3001 : The application is using arguments.........
I want to export data from the Ms-Access database to the excel file thru VB.
I have written the following code on the click of a button.......
Open_Connection
sqlstr = "Select * from report"
MyRS2.CursorLocation = adUseClient
MyRS2.Open sqlstr, myconn, adOpenStatic, adLockBatchOptimistic
MyRS2.MoveFirst
Public Sub Open_Connection()
Dim database As String
database = "autodial"
Set myconn = New ADODB.Connection
myconn.ConnectionString Provider=Microsoft.Jet.OLEDB.3.51;Data Source= autodial.mdb;"
myconn.Open
End Sub
now in this code this error is coming "runtime error 3001 : The application is using arguments that are of wrong type, are out of acceptable range, or are in conflict with one another". This error is coming while opening the connection i.e. myrs2.open sqlstr....... statement.
what is the problem in this code?
You are what your strong Desire is...
As your desire is , so is your Will...
As your will is, so is your Deed...
As your deed is ,so is your Fate.
-
February 20th, 2004, 04:42 AM
#2
runtime error 3001 ...
This usally happens when you're using a provider that does not
support some operations (like fetching, which in your case,
is indicated by the "adLockBatchOptimistic")
You can try:
a)
change provider (try jet 4.0)
or b)
Open serverside,
create a NewRs clientside
Mapp all fields to new rs
Copy all records
close first recordset
return NewRs
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
February 20th, 2004, 04:44 AM
#3
Watch out for this one.. I think you have missed something..
myconn.ConnectionString Provider=Microsoft.Jet.OLEDB.3.51;Data Source= autodial.mdb;"
It must be...
myconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source= autodial.mdb;"
Busy
-
February 20th, 2004, 06:21 AM
#4
Nice, Thread1!
I completely missed the main thing! Nice you saw it!!
Strange mistake, however: Vb should not let it pass...
By the way ascom:
if you do not attach anything else, skip last ";"
Last edited by Cimperiali; February 20th, 2004 at 06:24 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|