maximyshka
asked on
Database connection with javaScript
How to connect to database with java script
ASKER
is it javascript. It looks like vb?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is there anyway to connect to database through odbc?
var DBConn = Server.CreateObject ('ADODB.Connection');
DBConn.Provider = "Microsoft.Jet.OLEDB.4.0"
DBConn.Open(Server.MapPath
if (DBConn.Errors.Count > 0)
Response.Write("Error")
example:
=========================
<script>
var conn = new ActiveXObject("ADODB.Conne
var connectionstring = "Provider=sqloledb; Data Source=itdev; Initial Catalog=pubs; User ID=sa;Password=yourpasswor
conn.Open(connectionstring
var rs = new ActiveXObject("ADODB.Recor
rs.Open("SELECT gif, description, page, location FROM menu1", conn)
// Be aware that I am selecting from this table, but you need to pick your own table
while(!rs.eof)
{
alert(rs(0));
rs.movenext
}
rs.close
conn.close
</script>