Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default connection string

    Hi there,

    I have recently changed the connection string on a site that was working
    perfectly.
    I used an OLE DB connection with this code:

    var path = Server.MapPath("/bddir");
    var MM_ss_bd_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" + path
    + "\\dbfile.mdb";

    and changed it to a Jet DB connection, with this code:

    var path = Server.MapPath("/bddir");
    var MM_ss_bd_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path
    + "\\dbfile.mdb;"

    Everything seemed to work fine, until yesterday, when the client told he
    couldn't insert information on one of the tables of the BD.
    In fact, changing the connection string, the insert (and update)
    functionality now returns an error on that particular table:
    Microsoft JET Database Engine error '80040e14'
    Syntax error in INSERT INTO statement.
    /Scripts/agenda-ins.asp, line 97

    Line 97 is where the behaviour tryes to execute the query.

    The strange thing is that it only happens on this page. I'm using the same
    insert functionality on other pages and it works fine.

    The query it executes is simple:

    insert into agenda (categoriaID,local,texto) values
    ('seae','wqerwer','rwwqer')

    The table agenda has the following structure:

    agendaID: autonumber
    categoriaID: text
    data: date
    local: text
    texto:texto

    Note: field 'data' is not necessary.

    Does anyboy have a clew?

    Thanx
    dio


    Dionísio Monteiro Guest

  2. Similar Questions and Discussions

    1. need help with connection string
      i keep reading that it is not secure to hard code the connection string to the server into my swf. so how can i get the string into my swf without...
    2. String in Web.config to specify AD connection
      I run a .NET based portal product. I am using windows authentication. This mode of authentication and the string specifying the connection to AD...
    3. 'Connection String not work'..
      I have this code looking at a registered dll, but i keep getting.. Object doesn't support this property or method: 'ConnectionString' line 9 <%...
    4. DB Connection String
      Hi, I need to store the database connection string inside web.config file. What would be the best way to encrypt and decrypt it? Thanks, Ali
    5. Encrypted Connection String
      How would I go about taking my DB connection strings and putting them into my Web.Config file in encrypted form? Of course, I'd need to know how to...
  3. #2

    Default Re: connection string

    I doubt this has anything to do with your connection string.

    You need to show some code. Are you building a dynamic sql statement (ugh!),
    or running a saved query (recommended)?

    If you are using dynamic sql, you will need to response.write the variable
    containing the sql statement so you can see what you are sending to the
    query engine.

    Bob Barrows

    Dionísio Monteiro wrote:
    > Hi there,
    >
    > I have recently changed the connection string on a site that was
    > working perfectly.
    > I used an OLE DB connection with this code:
    >
    > var path = Server.MapPath("/bddir");
    > var MM_ss_bd_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="
    > + path + "\\dbfile.mdb";
    >
    > and changed it to a Jet DB connection, with this code:
    >
    > var path = Server.MapPath("/bddir");
    > var MM_ss_bd_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > + path + "\\dbfile.mdb;"
    >
    > Everything seemed to work fine, until yesterday, when the client told
    > he couldn't insert information on one of the tables of the BD.
    > In fact, changing the connection string, the insert (and update)
    > functionality now returns an error on that particular table:
    > Microsoft JET Database Engine error '80040e14'
    > Syntax error in INSERT INTO statement.
    > /Scripts/agenda-ins.asp, line 97
    >
    > Line 97 is where the behaviour tryes to execute the query.
    >
    > The strange thing is that it only happens on this page. I'm using the
    > same insert functionality on other pages and it works fine.
    >
    > The query it executes is simple:
    >
    > insert into agenda (categoriaID,local,texto) values
    > ('seae','wqerwer','rwwqer')
    >
    > The table agenda has the following structure:
    >
    > agendaID: autonumber
    > categoriaID: text
    > data: date
    > local: text
    > texto:texto
    >
    > Note: field 'data' is not necessary.
    >
    > Does anyboy have a clew?
    >
    > Thanx
    > dio


    Bob Barrows Guest

  4. #3

    Default Re: connection string

    thank you, the fact that one of the DB fields was called 'local' caused the
    problem. 'local' is a reserved word on Jet.OLEDB.

    best regards,
    dio

    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:OMZWpCpgDHA.2984@TK2MSFTNGP11.phx.gbl...
    > I doubt this has anything to do with your connection string.
    >
    > You need to show some code. Are you building a dynamic sql statement
    (ugh!),
    > or running a saved query (recommended)?
    >
    > If you are using dynamic sql, you will need to response.write the variable
    > containing the sql statement so you can see what you are sending to the
    > query engine.
    >
    > Bob Barrows
    >
    > Dionísio Monteiro wrote:
    > > Hi there,
    > >
    > > I have recently changed the connection string on a site that was
    > > working perfectly.
    > > I used an OLE DB connection with this code:
    > >
    > > var path = Server.MapPath("/bddir");
    > > var MM_ss_bd_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="
    > > + path + "\\dbfile.mdb";
    > >
    > > and changed it to a Jet DB connection, with this code:
    > >
    > > var path = Server.MapPath("/bddir");
    > > var MM_ss_bd_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > > + path + "\\dbfile.mdb;"
    > >
    > > Everything seemed to work fine, until yesterday, when the client told
    > > he couldn't insert information on one of the tables of the BD.
    > > In fact, changing the connection string, the insert (and update)
    > > functionality now returns an error on that particular table:
    > > Microsoft JET Database Engine error '80040e14'
    > > Syntax error in INSERT INTO statement.
    > > /Scripts/agenda-ins.asp, line 97
    > >
    > > Line 97 is where the behaviour tryes to execute the query.
    > >
    > > The strange thing is that it only happens on this page. I'm using the
    > > same insert functionality on other pages and it works fine.
    > >
    > > The query it executes is simple:
    > >
    > > insert into agenda (categoriaID,local,texto) values
    > > ('seae','wqerwer','rwwqer')
    > >
    > > The table agenda has the following structure:
    > >
    > > agendaID: autonumber
    > > categoriaID: text
    > > data: date
    > > local: text
    > > texto:texto
    > >
    > > Note: field 'data' is not necessary.
    > >
    > > Does anyboy have a clew?
    > >
    > > Thanx
    > > dio
    >
    >
    >

    Dionísio Monteiro Guest

  5. #4

    Default Connection string

    Hi

    Sorry if I'm off topic but I am a touch desperate

    We make use of a mysql 4.x hosted by a third party and we use ASP to access
    this data

    Our Connection string looks like this:

    xDb_Conn_Str="DRIVER=org.gjt.mm.mysql.Driver;URL={ jdbc:mysql://xxxxxxx/xxxxx
    xx};uid=xxxxxxx;pwd=xxxxxxxxxx;"

    This has worked fine for months but for some reason now we get Cannot Find
    Server

    I can access the Data Source using MySQL Control Center and via an ODBC
    connection from my PC, using the same info thats in the connection string,
    our host says nothing has changed.





    Any pointers really appreciated.

    Regards

    John Berman

    [email]John_berman@blueyonder.co.uk[/email]


    John Berman Guest

  6. #5

    Default Re: Connection string

    see @ [url]http://www.connectionstrings.com[/url]

    --
    -------
    Pawel Janowski
    [url]http://www.sunrise-tm.com/os_janowski.aspx[/url]


    Pawe³ Janowski Guest

  7. #6

    Default connection string

    I have the followng string in my web.config file.
    <add key="DBConnInfo" value="Data Source=SQL01;Initial
    Catalog=DatabaseName;Trusted_Connection=No;Persist
    Security Info=True;User id=sa;password=password;" />
    Where I am passing a user id to be connected to a sql db.
    Instead of passing a user I would like to get current user
    windows id pass to the string.How do I do this?
    anonymous Guest

  8. #7

    Default Re: connection string

    "server=foo;database=bar;trusted_connection=tr ue;"

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > I have the followng string in my web.config file.
    > <add key="DBConnInfo" value="Data Source=SQL01;Initial
    > Catalog=DatabaseName;Trusted_Connection=No;Persist
    > Security Info=True;User id=sa;password=password;" />
    > Where I am passing a user id to be connected to a sql db.
    > Instead of passing a user I would like to get current user
    > windows id pass to the string.How do I do this?


    Brock Allen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139