I hope someone may be knowledged enough to help me???
I would be willing to pay if we were to get this working properly.
Email me if you are interested...and as this is part of a project/contract...you would also get credited for your help inside the code (hesaigo999@hotmail.com)
I am trying to open an excel file on the webserver to parse the info into sql server db.
Using asp i have the following code below...but i keep getting the errors
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xd54 Thread 0xf10 DBC 0x13661c4 Excel'.
I checked the fields inaide to make sure that they were all text or numerics and no mixed...
I also checked the file permissions and they are all set to full control r/w/e
I also included the adovbs.inc and have already inserted data previously to this into the db so I know its not the db conn string.
My viewexcelsheet.asp ( remember it has all its includes from other files linked by piggy back )
<%
Call header() ' this is the html header part with no important stuff
Call GetKarPowerInfoIntoDB
Call footer() ' this is the html footer with no important stuff
%>
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''
function CreateExcelRecordset(xlsfi
le,sheet)
Set objConn = Server.CreateObject("ADODB
.Connectio
n")
objConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & "DBQ=" & Server.MapPath( xlsfile )
set CreateExcelRecordset = Server.CreateObject("ADODB
.Recordset
") ' open excel Sheet
CreateExcelRecordset.Open "Select * From [" & sheet & "$]",objConn, adOpenStatic , adLockPessimistic
end function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''''''
sub GetKarPowerInfoIntoDB()
Set m_recordSet = CreateExcelRecordset( "/companyname/uploads/exce
lfile.XLS"
, "excelfile" )
if Not m_recordSet.EOF then %>
<TABLE Border=1 CellPadding=3>
<TR>
<% for f = 0 To m_recordSet.Fields.Count-1
%>
<TH><% = m_recordSet.Fields(f).name
%></TH>
<% next %>
</TR>
<% do while Not m_recordSet.eof %>
<TR>
<% for f = 0 To m_recordSet.Fields.Count-1
%>
<TD><% = m_recordSet.Fields(f).valu
e %></TD>
<% next %>
</TR>
<% m_recordSet.MoveNext
loop %>
</TABLE>
<% end if
end sub