Ask a Question related to ASP Database, Design and Development.
-
Bob Barrows [MVP] #1
Re: CSV to Access
CJA wrote:
What are the symptoms? Do you get any error messages? Could it be attempting> Hi
>
> I have a very simple script that seems to work OK inserting into an
> Access table from a CSV file. The problem I have is that the first
> column (stored as text) has student ID numbers - some start with
> 100... others start with a character like K or M. It inserts the
> 100... IDs but not the rest. Anyone any ideas?
to insert text into a numeric field?
Why do you assign this text to the SQL variable:> Here is the code:
>
> set objConn= Server.CreateObject("ADODB.Connection")
>
> strDBPath = Server.MapPath("../DB/Live.mdb")
> objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> strDBPath & ";"
>
> Dim csv_path
> csv_path = Server.MapPath("./Uploads") & "\"
>
>and immediately overwrite it with this text?> SQL = "SELECT * INTO Learner FROM [Learner2.csv] IN """ &
> csv_path & """ ""TEXT;"""
>
Bob Barrows> SQL = "INSERT INTO Learner SELECT * FROM [Learner2.csv] IN """ &
> csv_path & """ ""TEXT;"""
>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Web Service + Anon Access, but getting 401 Access Denied Error
I have a simple webservice that just returns a string. The security for this is set to windows authentication in IIS (XP Professional) and anonymous... -
Network File access using anonymous access
I have seen a number of entries related to accessing remote resources (files in my case) that need to reside on a remote server. We must leave our... -
Access 2002 PDFWriter VBA Code w/WinXP does not work like Access 2000
I am trying to print an Access 2002 report (Windows XP OS) as a PDF. I had success with Access 2000 in a Windows 2000 environment, but as soon as I... -
Access Violation when using Visual Interdev to access Oracle
I am running Windows 200 Pro, IIS 5.0 and trying to connect to an Oracle 8.1 database. Prior to applying a security patch to W2k, the ASP... -
Access denied when creating Access application object
In an ASP file I am running the following in VBScript in order to extract data from an Access 2002 MDB file which is physically located in the... -
CJA #2
CSV to Access
Hi
I have a very simple script that seems to work OK inserting into an
Access table from a CSV file. The problem I have is that the first
column (stored as text) has student ID numbers - some start with 100...
others start with a character like K or M. It inserts the 100... IDs but
not the rest. Anyone any ideas? Here is the code:
set objConn= Server.CreateObject("ADODB.Connection")
strDBPath = Server.MapPath("../DB/Live.mdb")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath
& ";"
Dim csv_path
csv_path = Server.MapPath("./Uploads") & "\"
SQL = "SELECT * INTO Learner FROM [Learner2.csv] IN """ & csv_path &
""" ""TEXT;"""
SQL = "INSERT INTO Learner SELECT * FROM [Learner2.csv] IN """ &
csv_path & """ ""TEXT;"""
'Executing the SQL Statement
ObjConn.Execute SQL
Hope someone has the answer.
CJA
CJA Guest
-
CJA #3
Re: CSV to Access
Hi Sorry about the cross-post. I am new to this.
I don't get any error messages. It just leaves the field blank if it comes
across an ID with a character at the begining. This is simply a bit of
script I found elsewhere. It works fine on other files. The field it
inserts into is text, so it should be OK.
CJA
CJA Guest



Reply With Quote

