PDA

Click to See Complete Forum and Search --> : please help me with asp/ultrdev


johnnyboy23
Dec 6th, 2000, 09:42 PM
im using dreamweaver ultrdev
evrytime i run my asp file that i created i get this error

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

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

Ianpbaker
Dec 7th, 2000, 03:22 AM
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

johnnyboy23
Dec 7th, 2000, 01:45 PM
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

Ianpbaker
Dec 8th, 2000, 02:53 AM
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