p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: ADO Active server pages


Message #1 by "Phil Perks" <philp@w...> on Mon, 3 Jul 2000 16:8:29

-----Original Message-----

From: Necuton P. Isaac [mailto:ton_isaac@j...]

Sent: 30 June 2000 19:09

To: philp@w...

Subject: 





Hello Sir, I bought one of your book  "Beginning Visual basic 6

database". It help's me a lot. I was very thankful to have this book. I

was working on chapter 13 now ADO Active server pages and it's all

working fine in my computer. I transfered all my asp pages, MDB, DLL to 

a free domain http://members.truepath/ton_isaac/ton_isaac but it is not

working here.  is it because of my ADODB.connection or some code in ASP?



 I to change the path connection to

"Data Source=http://members.truepath/ton_isaac/ton_isaac/visitors.mdb" 

is this a correct syntax?         



this is my website

http://members.truepath/ton_isaac/ton_isaac/login.asp



Thank you very much and hoping to hear from you.

Newton P. Isaac 







Public Function setVisitor(ByVal firstName As Variant, ByVal lastName As

Variant) As Variant



Dim adoConnection As ADODB.Connection

Dim adoRecordset As ADODB.Recordset

Dim connectString As String



connectString = "Provider=Microsoft.Jet.OLEDB.3.51;" & _

                 "Data

Source=http://members.truepath/ton_isaac/ton_isaac/visitors.mdb"



Set adoConnection = CreateObject("ADODB.Connection")

Set adoRecordset = CreateObject("ADODB.Recordset")



adoConnection.Open connectString

adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _

                               adOpenDynamic, adLockOptimistic



With adoRecordset

   .AddNew

   !firstName = firstName

   !lastName = lastName

   !previousVisit = Now()

   !totalVisits = 1

   .Update

End With



'-- Return a unique ID so we can set the cookie

setVisitor = adoRecordset!cookieID



'-- Close the recordset and the connection

adoRecordset.Close

adoConnection.Close



End Function

Message #2 by "Ken Schaefer" <ken.s@a...> on Tue, 4 Jul 2000 23:39:24 +1000

>  I to change the path connection to

> "Data Source=http://members.truepath/ton_isaac/ton_isaac/visitors.mdb"

> is this a correct syntax?



If visitors.mdb is in your WWW root then



"Data Source=" & Server.Mappath("/visitors.mdb")



If it is in another directory underneath the web root add the path as

appropriate



Cheers

Ken






  Return to Index