sanjeev_prasad
June 26th, 2001, 03:24 AM
Having written an ASP program using Java script, I now want to connect to database and store data. How is this done?
Sanjeev
Sanjeev
|
Click to See Complete Forum and Search --> : ASP- Data base connectivity sanjeev_prasad June 26th, 2001, 03:24 AM Having written an ASP program using Java script, I now want to connect to database and store data. How is this done? Sanjeev pmmbala June 26th, 2001, 06:22 AM Hi, I think using java script we cannot do that Using vb script Dim objCon 'Connection String 'Create a Connection Object set objCon = Server.CreateObject ("adodb.connection") ' if the backend sql server then using dsn name call test objCon.Open "filedsn=test" ' if the backend MS Access then 'dsntelly="DRIVER={Microsoft Access Driver (*.mdb)}; " 'dsntelly=dsntelly & "DBQ=" & Server.Mappath("test.mdb") 'objCon.Open dsntelly pmmbala_old June 26th, 2001, 06:22 AM Hi, I think using java script we cannot do that Using vb script Dim objCon 'Connection String 'Create a Connection Object set objCon = Server.CreateObject ("adodb.connection") ' if the backend sql server then using dsn name call test objCon.Open "filedsn=test" ' if the backend MS Access then 'dsntelly="DRIVER={Microsoft Access Driver (*.mdb)}; " 'dsntelly=dsntelly & "DBQ=" & Server.Mappath("test.mdb") 'objCon.Open dsntelly goddess_spanky June 26th, 2001, 03:17 PM You are correct about not being able to update a database using javascript because it is run client-side. you must use vbscript to execute the update on the server. Javascript is good for data validation before the data hits the server. Thanks~ ~goddess goddess_spanky@hotmail.com codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |