Results 1 to 4 of 4

Thread: please help me with asp/ultrdev

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    Unhappy

    im using dreamweaver ultrdev
    evrytime i run my asp file that i created i get this error
    Code:
    Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
    
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
    
    /TMP1nf1w56ia4.asp, line 61
    when i look at my html line number 61 vb script i see the below code
    Code:
    Recordset1.ActiveConnection = "dsn=BNW;uid=sa;"
    Recordset1.Source = "select * from employee"
    im trying to update a record in my sql7 database dsn name =bnw uid =sa

    please help me im new to asp and still learning but i have a really good understanding of slq7 and vb6
    help needed thanbkyou i have been on this for 3 days








  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Use the following to connect to the database

    Dim objCon
    Dim objRecordset
    Dim strSQL

    Set objCon = Server.CreateObject("ADODB.Connection")
    Set objRecordset = Server.CreateObject("ADODB.Recordset")


    oConn.Open "DSN=BNW;" & _
    "Uid=sa;" & _
    "Pwd=;
    strSQL = "select * from employee"

    objRecordset.Open strSQL,objCon,adopendynamic


    You need to make sure that the dsn is on the webserver, if you can't get to it, to add to it, post the name of the SQL server and i'll show you another way of connecting to it

    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    thankjs

    dsn on my webserver???????
    i dont think i have that???
    i have a dsn setup on my machine?????
    but i dunno about the webserver??????


    my sql servers name is nt004
    my webserversname is nt008

    please be patient with me this is the first week for me in asp developement but know vb and sql really well
    thanks

  4. #4
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    In that case you can use the following code to connect to your sql server without using a dsn

    <%
    Dim objCon
    Dim objRec
    Dim strSQL

    Set objCon = Server.CreateObject("ADODB.Connection")
    Set objRec = Server.CreateObject("ADODB.Recordset")

    objCon.Open "Driver={SQL Server};Server=nt004;Database=enterhere;Uid=sa;Pwd=;"

    strSQL = "select * from employee"
    Objrec.Open strSQL,objCon,adOpenDynamic
    %>

    with asp, you need to take into account that everything is late binding, unlike vb where you can set everything u at design time. Also that all variables are variants and have to be manipulated accordingly.

    Finally at the bottom of you page, make sure you set the objects to nothing, otherwise you can start getting problem's with you web server

    <%
    Set objRec = Nothing
    Set objCon = Nothing
    %>

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

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



Click Here to Expand Forum to Full Width