Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Jim #1
Excel into Access using ASP with DWMX
Hi
Anyone know an ASP script for transferring data from an Excel sheet to an
Access table, some of the fields of which contain names which have an
apostrophe (') in them.
I have tried all sorts of things but am getting tripped up by the apostrophe
which is used as a field container in the SQL :
"INSERT INTO tblResults Values(0,'" & rsExcel("FeisID") & "' , '" &
rsExcel("CompNo") & "' , '" & rsExcel("Entry") & "' , '" & rsExcel("Name") &
"' , '" & rsExcel("School") & "' , '" & rsExcel("Position") & "' , '0' , '"
& Done & "')"
The first field is the ID field of tblResults and need to be incremented
automatically. If I leave the first value out, I get an error along the
lines of "Number of query values and destination fields are not the same"
Also, if the name field is like Harry O'Hare, the thing fails...
Any ideas anyone? Many thanks
Jim
Jim Guest
-
Excel to an Access DB
I have an office that would like to have an Excel Spreadsheet with a training roster put onto our website with the ability to Insert/Update/Delete. ... -
Name Redefined? What is this Dim? (DWMX/ASP/VBscript/Access)
Hi, I've been having this problem with a few sites now. It appears that in some cases, and I can't spot a trend, but when I add a recordset to a... -
Export from Excel to Access using ASP in DWMX
Hi Anyone know an ASP script for transferring data from an Excel sheet to an Access table, some of the fields of which contain names which have an... -
ASP Access 2 Excel
Hello All, I've got a small'ish Access 2000 database which I'd like to be able to convert to Excel then email to the owner. I was hoping to use... -
DWMX V6.0 and DWMX V7.0 Lost Feature - TIMELINE
DWMX V6.0 and DWMX V7.0 Lost Feature - TIMELINE Has anyone noticed the "MODIFY timeline" feature in DWMX Version 6.0 is gone in DWMX V7.0. The... -
webshorts #2
Re: Excel into Access using ASP with DWMX
Hi Jim, You'll need to do a replace on the fields to get rid of the single
quotes. The best way is to first build yourself a function, like so: <%
function cleanString(myStr) cleanString = Replace(myStr, ''', '''') end
function %> Then, wrap that around each of your values: INSERT INTO
tblResults VALUES (0, '' & cleanString(rsExcel('FeisID') & '', ...
That will allow you to insert apostrophes into the database by escaping them
with double apostrophes. Hope that helps.
webshorts Guest



Reply With Quote

