ASP connect to MS SQL Server 2000

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

  1. #1

    Default ASP connect to MS SQL Server 2000

    Hi Ng,

    i'm a nebie to ASP so please be kind ,-)

    I'd like to access (read and write data) from asp on (IIS if this Information is
    needed) MS SQLServer 2000 installed Databased.
    Let's say i've got a database called TESTDB with a table called TESTTABLE.
    A ASP File lying on Serverside.

    So can someone please give me a code example how to access the Server??



    Thanks for Help

    Jan


    Jan Schmidt Guest

  2. Similar Questions and Discussions

    1. mx7 connect to sql server 2000
      I have been able to set up a datasource that verifies and connects to the database. But when I run queries through coldfusion, I get 'invalid...
    2. Connect to SQL Server 2000 named instance from CF 4.5?
      Has anyone connected to a SQL Server 2k named instance from CF 4.5? Yes believe it or not we are still using 4.5. I do not see a place in the Data...
    3. Can't connect to SQL 2000
      I just installed MX7 and I can not connect to SQL 2000 I get the error Connection verification failed for data source: evan...
    4. Error in COM+ while migrating from 2000 Server to 2000 Advace Server
      Hi, I have one 3 tier architecture application running on Windows 2000 Server. I have created replica of same machine on another machine where OS...
    5. Error while porting applicaition from 2000 Server to 2000 advace Server
      Hi, I have one 3 tier architecture application running on Windows 2000 Server. I have created replica of same machine on another machine where OS...
  3. #2

    Default Re: ASP connect to MS SQL Server 2000

    Either start with some ASP tutorials, i.e.
    [url]http://www.w3schools.com/asp/default.asp[/url], or stop right where you are, skip
    ASP, and go right to ASP.net. ASP.net is really the way you should go if
    you're familiar with neither ASP nor ASP.net. Classic ASP is old and is
    quickly becoming a not-so-desired skillset.

    Ray at work

    "Jan Schmidt" <histery@gmx.net> wrote in message
    news:c6bied$9tb7q$1@ID-55072.news.uni-berlin.de...
    > Hi Ng,
    >
    > i'm a nebie to ASP so please be kind ,-)
    >
    > I'd like to access (read and write data) from asp on (IIS if this
    Information is
    > needed) MS SQLServer 2000 installed Databased.
    > Let's say i've got a database called TESTDB with a table called TESTTABLE.
    > A ASP File lying on Serverside.
    >
    > So can someone please give me a code example how to access the Server??
    >
    >
    >
    > Thanks for Help
    >
    > Jan
    >
    >

    Ray at Guest

  4. #3

    Default Re: ASP connect to MS SQL Server 2000

    Yes, thank you,

    i know ASP is old school, but i am forced to create the project in ASP.
    I am used to PHP, but what i see is that ASP is quiet diffrent. So your Link is
    was what i need, but i still can't find a DB-Access example Code to MS SQL
    Server...
    I think i need an example Code dor try and error learning.

    Jan


    Jan Schmidt Guest

  5. #4

    Default Re: ASP connect to MS SQL Server 2000

    Eh, php isn't that much different. All the concepts are the same, more or
    less. It's just a matter of learning the syntax for the language you choose
    to use in ASP.

    In classic ASP, you use ADO to connect to databases.
    [url]http://www.w3schools.com/ado/default.asp[/url]

    Here's the simplest of code:

    Dim oADO, oRS, sSQL
    sSQL = "SELECT [ID],[Name] FROM [People] ORDER BY [Name]"
    Set oADO = CreateObject("ADODB.Connection")
    oADO.Open "Provider=sqloledb;Data Source=YourSQLServer;Initial
    Catalog=yourDB;User Id=sqlUsername;Password=thePassword;" '''that was all
    one line
    Set oRS = oADO.Execute(sSQL)
    If Not oRS.EOF Then
    Do While Not oRS.EOF
    %>
    <a
    href="details.asp?id=<%=oRS.Fields.Item(0).Value%> "><%=oRS.Fields.Item(1).Va
    lue%></a><br>
    <%
    oRS.MoveNext
    Loop
    End If
    oRS.Close : Set oRS = Nothing
    oADO.Close : Set oADO = Nothing
    %>


    Ray at work



    "Jan Schmidt" <histery@gmx.net> wrote in message
    news:c6bl10$a9l8m$1@ID-55072.news.uni-berlin.de...
    > Yes, thank you,
    >
    > i know ASP is old school, but i am forced to create the project in ASP.
    > I am used to PHP, but what i see is that ASP is quiet diffrent. So your
    Link is
    > was what i need, but i still can't find a DB-Access example Code to MS SQL
    > Server...
    > I think i need an example Code dor try and error learning.
    >
    > Jan
    >
    >

    Ray at Guest

  6. #5

    Default Re: ASP connect to MS SQL Server 2000

    On Fri, 23 Apr 2004 19:50:44 +0200, "Jan Schmidt" <histery@gmx.net>
    wrote:
    >I am used to PHP, but what i see is that ASP is quiet diffrent. So your Link is
    >was what i need, but i still can't find a DB-Access example Code to MS SQL
    >Server...
    Have a look at:

    [url]http://www.able-consulting.com/ADO_Conn.htm[/url]

    Jeff
    Jeff Cochran Guest

  7. #6

    Default Re: ASP connect to MS SQL Server 2000

    yes thank you that's great.

    That's a nice example, it works quiet good
    i think i got it.

    Thank you

    Chears


    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> schrieb im
    Newsbeitrag news:OAtyA1VKEHA.1132@TK2MSFTNGP12.phx.gbl...
    > Eh, php isn't that much different. All the concepts are the same, more or
    > less. It's just a matter of learning the syntax for the language you choose
    > to use in ASP.
    >
    > In classic ASP, you use ADO to connect to databases.
    > [url]http://www.w3schools.com/ado/default.asp[/url]
    >
    > Here's the simplest of code:
    >
    > Dim oADO, oRS, sSQL
    > sSQL = "SELECT [ID],[Name] FROM [People] ORDER BY [Name]"
    > Set oADO = CreateObject("ADODB.Connection")
    > oADO.Open "Provider=sqloledb;Data Source=YourSQLServer;Initial
    > Catalog=yourDB;User Id=sqlUsername;Password=thePassword;" '''that was all
    > one line
    > Set oRS = oADO.Execute(sSQL)
    > If Not oRS.EOF Then
    > Do While Not oRS.EOF
    > %>
    > <a
    > href="details.asp?id=<%=oRS.Fields.Item(0).Value%> "><%=oRS.Fields.Item(1).Va
    > lue%></a><br>
    > <%
    > oRS.MoveNext
    > Loop
    > End If
    > oRS.Close : Set oRS = Nothing
    > oADO.Close : Set oADO = Nothing
    > %>
    >
    >
    > Ray at work
    >
    >
    >
    > "Jan Schmidt" <histery@gmx.net> wrote in message
    > news:c6bl10$a9l8m$1@ID-55072.news.uni-berlin.de...
    > > Yes, thank you,
    > >
    > > i know ASP is old school, but i am forced to create the project in ASP.
    > > I am used to PHP, but what i see is that ASP is quiet diffrent. So your
    > Link is
    > > was what i need, but i still can't find a DB-Access example Code to MS SQL
    > > Server...
    > > I think i need an example Code dor try and error learning.
    > >
    > > Jan
    > >
    > >
    >
    >

    Jan Schmidt Guest

  8. #7

    Default Re: ASP connect to MS SQL Server 2000

    Very good Side,

    helped me out,
    Thank you

    Chears



    "Jeff Cochran" <jcochran.nospam@naplesgov.com> schrieb im Newsbeitrag
    news:40897cb3.118160145@msnews.microsoft.com...
    > On Fri, 23 Apr 2004 19:50:44 +0200, "Jan Schmidt" <histery@gmx.net>
    > wrote:
    >
    > >I am used to PHP, but what i see is that ASP is quiet diffrent. So your Link
    is
    > >was what i need, but i still can't find a DB-Access example Code to MS SQL
    > >Server...
    >
    > Have a look at:
    >
    > [url]http://www.able-consulting.com/ADO_Conn.htm[/url]
    >
    > Jeff

    Jan Schmidt Guest

  9. #8

    Default Re: ASP connect to MS SQL Server 2000

    Glad to hear it. :]

    Ray at work

    "Jan Schmidt" <histery@gmx.net> wrote in message
    news:c6rg7n$f8v5e$1@ID-55072.news.uni-berlin.de...
    > yes thank you that's great.
    >
    > That's a nice example, it works quiet good
    > i think i got it.
    >
    > Thank you
    >
    > Chears
    >
    >
    > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> schrieb im
    > Newsbeitrag news:OAtyA1VKEHA.1132@TK2MSFTNGP12.phx.gbl...
    > > Eh, php isn't that much different. All the concepts are the same, more
    or
    > > less. It's just a matter of learning the syntax for the language you
    choose


    Ray at 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