connection string problem (going nutz)

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

  1. #1

    Default connection string problem (going nutz)

    Can someone please provide me with an example conntection string to connect
    to an access database that is using jet security (mdw file)?

    I want to use Internet Explorer and asp/ado to connect to an access database
    and I have not been successfull in even connecting to it. The only way I got
    it to work was using a system DSN and it only worked intermittently?

    I have found 3 different syntax examples from microsoft and could get none
    of them to work. I think maybe they were for access/ado instead of asp/ado.
    I'm not sure. But I would really love a simple example of the correct syntax
    for what I need to do

    anyone?

    Thanks in advance!


    djc 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. WebServiceConnector driven me nutz
      I am having the exact same problem as you are. I have tried everything including uninstalling Flash MX Professional. Any ideas...anyone?:disgust;
    3. 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...
    4. problem defining a custom connection string
      Hi, could someone please help with a problem I am having. When I try to create a connection string using DW's custom connection string...
    5. Global.asa - Driving me nutz
      the ASA is in the ROOT of the VirtDit Application. Make sure that the Application is created. --...
  3. #2

    Default Re: connection string problem (going nutz)


    "djc" <noone@nowhere.com> wrote in message
    news:%23vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > Can someone please provide me with an example conntection string to
    connect
    > to an access database that is using jet security (mdw file)?
    [url]www.connectionstrings.com[/url]

    Use the oledb one.

    Ray at work


    Ray at Guest

  4. #3

    Default Re: connection string problem (going nutz)

    "djc" <noone@nowhere.com> wrote in message
    news:%23vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > Can someone please provide me with an example conntection string to
    connect
    > to an access database that is using jet security (mdw file)?
    >
    > I want to use Internet Explorer and asp/ado to connect to an access
    database
    > and I have not been successfull in even connecting to it. The only way I
    got
    > it to work was using a system DSN and it only worked intermittently?
    >
    > I have found 3 different syntax examples from microsoft and could get none
    > of them to work. I think maybe they were for access/ado instead of
    asp/ado.
    > I'm not sure. But I would really love a simple example of the correct
    syntax
    > for what I need to do
    >
    > anyone?
    If you shared with us exactly what "could get none of them to work" means,
    we may be able to provide you an answer as to how to get it to work ...

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]



    Tom Kaminski [MVP] Guest

  5. #4

    Default Re: connection string problem (going nutz)

    "djc" <noone@nowhere.com> wrote in message
    news:#vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > Can someone please provide me with an example conntection string to
    connect
    > to an access database that is using jet security (mdw file)?
    >
    > I want to use Internet Explorer and asp/ado to connect to an access
    database
    > and I have not been successfull in even connecting to it. The only way I
    got
    > it to work was using a system DSN and it only worked intermittently?
    >
    > I have found 3 different syntax examples from microsoft and could get none
    > of them to work. I think maybe they were for access/ado instead of
    asp/ado.
    > I'm not sure. But I would really love a simple example of the correct
    syntax
    > for what I need to do
    >
    > anyone?
    >
    > Thanks in advance!

    Will this code help?

    <% @Language = "VBScript" %>
    <% Option Explicit
    '*
    '* Declare Constants
    '*
    Const cASP = "accessor.asp"
    Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    Const cMDB = "your_access_database.mdb"
    Const cTBL = "your_table_name"
    '*
    '* Declare Variables
    '*
    Dim strDSN
    strDSN = cDSN & Server.MapPath(cMDB)
    Dim intRST
    intRST = 0
    Dim strSQL
    strSQL = "SELECT * FROM " & cTBL
    Response.Write("<br>" & strSQL)
    '*
    '* Declare Objects
    '*
    Dim objADO
    Set objADO = Server.CreateObject("ADODB.Connection")
    objADO.Open strDSN
    Dim objRST
    Set objRST = objADO.Execute(strSQL)
    '*
    '* Process
    '*
    Do While Not objRST.EOF
    intRST = intRST + 1
    '...
    objRST.MoveNext
    Loop
    Response.Write("<br>" & intRST & " records read")
    '*
    '* Cleanup Objects
    '*
    Set objRST = Nothing
    Set objADO = Nothing
    %>


    McKirahan Guest

  6. #5

    Default Re: connection string problem (going nutz)

    thanks ray.

    this is copy/pasted from that site:

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
    OLEDB:System Database=system.mdw;","admin", ""

    The placement of the quotes are confusing me. Here is my connection string:

    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _

    & "Data Source=C:\websvr\aspadotest.mdb;" _

    & "Jet OLEDB:System database=C:\tech.mdw;" _

    & "," & """" & "dsmith" & """" & "," & """" & "password" &
    """"

    Do you know whats wrong with this?





    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:eh9PjszlDHA.964@TK2MSFTNGP10.phx.gbl...
    >
    > "djc" <noone@nowhere.com> wrote in message
    > news:%23vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > > Can someone please provide me with an example conntection string to
    > connect
    > > to an access database that is using jet security (mdw file)?
    >
    > [url]www.connectionstrings.com[/url]
    >
    > Use the oledb one.
    >
    > Ray at work
    >
    >

    djc Guest

  7. #6

    Default Re: connection string problem (going nutz)

    djc wrote:
    > thanks ray.
    >
    > this is copy/pasted from that site:
    >
    > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
    > OLEDB:System Database=system.mdw;","admin", ""
    This does not seem right. Here's an example from
    [url]www.able-consulting.com/ado_conn.htm:[/url]
    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=c:\somepath\mydb.mdb;" & _
    "Jet OLEDB:System Database=MySystem.mdw", _
    "myUsername", "myPassword"

    Give this a try.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  8. #7

    Default Re: connection string problem (going nutz)

    That did it! THANK YOU!

    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:OSyD6m0lDHA.1764@tk2msftngp13.phx.gbl...
    > djc wrote:
    > > thanks ray.
    > >
    > > this is copy/pasted from that site:
    > >
    > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
    > > OLEDB:System Database=system.mdw;","admin", ""
    >
    > This does not seem right. Here's an example from
    > [url]www.able-consulting.com/ado_conn.htm:[/url]
    > oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > "Data Source=c:\somepath\mydb.mdb;" & _
    > "Jet OLEDB:System Database=MySystem.mdw", _
    > "myUsername", "myPassword"
    >
    > Give this a try.
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >

    djc Guest

  9. #8

    Default Re: connection string problem (going nutz)

    sorry for the lack of detail. Bob Barrows reply had an example that was
    clearer than what I was using. It was a syntax error...

    thanks for the reply.

    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:bn1b7d$m1b9@kcweb01.netnews.att.com...
    > "djc" <noone@nowhere.com> wrote in message
    > news:%23vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > > Can someone please provide me with an example conntection string to
    > connect
    > > to an access database that is using jet security (mdw file)?
    > >
    > > I want to use Internet Explorer and asp/ado to connect to an access
    > database
    > > and I have not been successfull in even connecting to it. The only way I
    > got
    > > it to work was using a system DSN and it only worked intermittently?
    > >
    > > I have found 3 different syntax examples from microsoft and could get
    none
    > > of them to work. I think maybe they were for access/ado instead of
    > asp/ado.
    > > I'm not sure. But I would really love a simple example of the correct
    > syntax
    > > for what I need to do
    > >
    > > anyone?
    >
    > If you shared with us exactly what "could get none of them to work" means,
    > we may be able to provide you an answer as to how to get it to work ...
    >
    > --
    > Tom Kaminski IIS MVP
    > [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running
    IIS
    > [url]http://mvp.support.microsoft.com/[/url]
    > [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]
    >
    >
    >

    djc Guest

  10. #9

    Default Re: connection string problem (going nutz)

    wow. Thanks for the detail. I actually (with the help of Bob Barrow's reply)
    found a syntax error in my connection string.

    I will however try out your code as well.

    Thanks!

    "McKirahan" <News@McKirahan.com> wrote in message
    news:UTWkb.510232$2x.216351@rwcrnsc52.ops.asp.att. net...
    > "djc" <noone@nowhere.com> wrote in message
    > news:#vSuJqzlDHA.1084@tk2msftngp13.phx.gbl...
    > > Can someone please provide me with an example conntection string to
    > connect
    > > to an access database that is using jet security (mdw file)?
    > >
    > > I want to use Internet Explorer and asp/ado to connect to an access
    > database
    > > and I have not been successfull in even connecting to it. The only way I
    > got
    > > it to work was using a system DSN and it only worked intermittently?
    > >
    > > I have found 3 different syntax examples from microsoft and could get
    none
    > > of them to work. I think maybe they were for access/ado instead of
    > asp/ado.
    > > I'm not sure. But I would really love a simple example of the correct
    > syntax
    > > for what I need to do
    > >
    > > anyone?
    > >
    > > Thanks in advance!
    >
    >
    > Will this code help?
    >
    > <% @Language = "VBScript" %>
    > <% Option Explicit
    > '*
    > '* Declare Constants
    > '*
    > Const cASP = "accessor.asp"
    > Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > Const cMDB = "your_access_database.mdb"
    > Const cTBL = "your_table_name"
    > '*
    > '* Declare Variables
    > '*
    > Dim strDSN
    > strDSN = cDSN & Server.MapPath(cMDB)
    > Dim intRST
    > intRST = 0
    > Dim strSQL
    > strSQL = "SELECT * FROM " & cTBL
    > Response.Write("<br>" & strSQL)
    > '*
    > '* Declare Objects
    > '*
    > Dim objADO
    > Set objADO = Server.CreateObject("ADODB.Connection")
    > objADO.Open strDSN
    > Dim objRST
    > Set objRST = objADO.Execute(strSQL)
    > '*
    > '* Process
    > '*
    > Do While Not objRST.EOF
    > intRST = intRST + 1
    > '...
    > objRST.MoveNext
    > Loop
    > Response.Write("<br>" & intRST & " records read")
    > '*
    > '* Cleanup Objects
    > '*
    > Set objRST = Nothing
    > Set objADO = Nothing
    > %>
    >
    >

    djc 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