Hi!
I have developed an application for uploading data from excel to ms sql.I'm getting the following error message:
3001:Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another
The code I'm using:
Can somebody tell me what's causing the error message?
Thanks in advance!
I have developed an application for uploading data from excel to ms sql.I'm getting the following error message:
3001:Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another
The code I'm using:
Code:
<%
Dim ADOrs
Dim SQLstr
Dim lngRecsAff
'As ADODB.Connection
'As String
'As Long
set ADOrs = Session("DataConn")
'Set ADOConn = Server.CreateObject("ADODB.Connection")
'ADOConn.Open "Provider=SQLOLEDB;Data Source=tmav035a;" & _
' "Initial Catalog=shopping_TSR.mds;User ID=Admin;"'Password=;"
'Import by using OPENROWSET and object name.
SQLstr = "SELECT * INTO shopping_TSRM FROM " &_
"OPENROWSET('Microsoft.Jet.OLEDB.4.0', " &_
"'Excel 8.0;Database=C:\inetpub\[URL unfurl="true"]wwwroot\Test_AssetDB\fileuploader\upload\tmb2.xls',[/URL] " & _
"'SELECT * FROM [Sheet1$]')"
'Debug.Print strSQL
ADOrs.Execute(strSQL)', lngRecsAff, adExecuteNoRecords
'Debug.Print "Records affected: " & lngRecsAff
'cn.Close
'Set cn = Nothing
'Response.Write(ADOrs.ErrorStr)
Response.Write("ADOrs error!!<br />" &ADOrs.ErrorStr & "<br />")
%>
Can somebody tell me what's causing the error message?
Thanks in advance!