yes ... as long as table name is worksheet name, and you have column headings. it's as if it's a regular database.
Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.
yes ... as long as table name is worksheet name, and you have column headings. it's as if it's a regular database.
Quote of the Month:
Planning: Much work remains to be done before we can announce our total failure to make any progress.
Questions to Ponder:
If convenience stores are open 24 hours a day, 365 days a year, why are there locks on the doors?
iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69
Great. Thanks for the help![]()
-Steve
Anybody know if you can sort by multiple criteria?
Here is code from a project I'm working on for a employee list by department.
I would like to order first by department, then by last name similar to what Excel will do with a data sort with multiple criteria. How would I do this?Code:strSQL = "SELECT * from photorange ORDER BY [Department]"
-Ben
just add the additional sort options at the end
Code:strSQL = "SELECT * from photorange ORDER BY [Department], [LastName]"
That was easy. Thanks!
-Ben
Small tip for people reading over this this line of code
Is where you can change the tables cords depending on how many rows you have in your excel spreadsheet allowing you to have more rows or collumns.Code:strSQL = "SELECT * FROM A2:Q10000"
A2:Q10000
Sorry to bump an old thread, will this work with open office installed and not excel ?
Is there anyway in achieving the same without office installed e.g. by reading a csv or text file.
no and no.Originally Posted by emzipoo4u
you'll have to find proper driver, if exists at all, for Open Office documents.
to read pure text file, use FSO, which is File System Object.
good luck!
Hi there
I've bee using some script given on this forum by Shadow Wizard to get information from a exel document to a MSSQL database.
It has been working very well until last month when our boss upgrade our machine with office 2007. Unless users ask to save
as excel 2003 when they upload the document it gives an error. I think is because the webserver is running on server 2003.
Is there any way I can sort this out?
Thank you
If this help you please show your gratitude by adding reputation points.
Thanks
JonyBravo
I guess you mean this thread? If not sorry, but it's related still.
Anyway I now edited the first post in the thread with code supporting
Excel 2007 files as well, just comment your original objConn.Open lines
and add the lines I've added in there.
To successfully open XLSX file you simply need to specify different
driver in the connection string, that's all..![]()
se the below code to read from Excel file as if it was database. note, Excel must be installed on the Server in order for this code to work, and the IUSR account must have permissions over the Excel file. Code: <% Option Explicit %> <html> <body> <% Dim objConn, objRS, strSQL Dim x, curValue Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "DRIVER={Microsoft Excel Driver (*....
Domain info for: aspfree.com
Right information and knowledge.
Thanks!!
Gillian Reynolds
Hi All,
I am adding to the old post.
I modified the code a bit and tried to update access database after uploading excel file but I am getting the following error message:
Error Type: Provider (0x80020005)
Type mismatch.
line 61
the error that I receive is on the below line
I have double checked that the data types for each field in Access and Excel are same.Code:rsAdd.Fields(xIndex).value=arrMy(xIndex)
Could any one please look into this and assist me.
Thanks and Regards
arrMy(x) will always be a string - it means you have one or more fields holding other data type so you'll have to cast the value using functions like CLng, CDate etc according to the type you have and the field index.
Thanks Shadow Wizard for your support and time
I resolved this problem...
The problem occurs when you have a column in the excel file which is not present in the MSAccess table and vice versa.
Also there should be no empty fields in the excel file. (this happen even if the column is not a primary key)
Thanks to all the members again....
Originally Posted by Shadow Wizard
Become Part of This Conversation
Join NowFor Free!