Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Can javascript read the data from MS SQL database?
pwint
Newbie

Posts: 1
Registered: 2/10/2005
Member Is Offline
posted on 2/10/2005 at 02:21 AM Reply With Quote
Can javascript read the data from MS SQL database?


Hi
I want to try to read the data from SQL database using javascript. When i change something in list/menu in a form it will run in onchange event and to read the data from SQL database according to the data number that receive from the list/menu in a form. Then this data should be loaded into another list/menu in the same form.
How can i do it? Can it be done with javascript?
Any help, suggestions welcome.

Pwint
View User's Profile View All Posts By User U2U Member
IntranetDeveloper
Junior Member

Posts: 6
Registered: 2/19/2005
Member Is Offline
posted on 2/27/2005 at 04:49 PM Reply With Quote
Can javascript read the data from MS SQL database?


Why don't you just use asp to pull the data from the database and use the script to handle to formatting?

Set objCon = Server.CreateObject ("ADODB.Connection")
objCon.Open strCon
Set objRec= Server.CreateObject ("ADODB.Recordset")
objRec.cursorlocation=aduseclient
objLevels.sort=" YourFieldName ASC"
strSQL = "SELECT * FROM Yourtable"
objRec.Open strSQL, objCon, adOpenStatic, adLockReadOnly, adCmdText


Do something like this to output your data in the table..

if (not ObjRec.bof) or (not objRec.eof)
Response.Write(CHR(13)&"<tr>")
Response.Write(CHR(13)&"<td>"&objRec("YourFieldName")&"")

Response.Write(CHR(13)&"</tr>")

objRec.movenext
end if

-J
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004