ASP to Access DB

Discussion in 'ASP General' started by CJA, Jun 20, 2004.

  1. CJA

    CJA Guest

    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, Jun 20, 2004
    #1
    1. Advertising

  2. CJA wrote:
    > Hi
    >
    > I have a very simple script that seems to work OK inserting into an


    Already answered over in .db

    Please do not multipost CJA. This is definitely a database-related
    question so .asp.db was the perfect group in which to post it. Posting it
    here as well did not increase your chances of getting an answer (most of us
    subscribe to both groups). On the contrary, if somebody had taken his time
    to answer it here, only to find that it was already resolved in the other
    group, that person may have been annoyed enough to ignore any future posts
    from you, thereby decreasing your chances of getting help in the future.

    There are times when you will not be sure which group is most appropriate
    (again, this was not one of them), and you will want to post a question to
    both groups. In that situation, you should use the cross-posting technique,
    rather than posting the same message multiple times. To crosspost, put
    a semicolon-delimited* list of the newsgroups to which you wish to post in
    the To: header of your post and post it once. It, and any replies to it,
    will appear in all the newsgroups in your list. So, if I reply in .asp.db,
    my reply will also appear here in .asp.general.

    * ... or whatever delimiter is recognized by your news client

    Bob Barrows
    --
    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], Jun 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGhpbA==?=

    Faster access to MDB? MS Access MDB and ASP

    =?Utf-8?B?UGhpbA==?=, Jan 26, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    509
    Kevin Spencer
    Jan 27, 2005
  2. Ros@
    Replies:
    3
    Views:
    654
  3. =?Utf-8?B?a21jY29za2V5?=

    ACCESS AN ACCESS DATABASE FROM ASP.NET INTRANET SCENARIO

    =?Utf-8?B?a21jY29za2V5?=, Apr 24, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    500
    =?Utf-8?B?a21jY29za2V5?=
    Apr 30, 2007
  4. Jay
    Replies:
    2
    Views:
    1,117
  5. kmccoskey
    Replies:
    2
    Views:
    285
    Paul Clement
    Apr 27, 2007
Loading...

Share This Page