...

View Full Version : Error during translation script from language VB to JavaScript



Lallo
03-19-2007, 04:06 PM
<script runat="server">
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("northwind.mdb"))
dbconn.Open()
sql="SELECT * FROM customers"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
customers.DataSource=dbread
customers.DataBind()
dbread.Close()
dbconn.Close()
end sub
</script>
I have problems with the
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) line, it gives the following error: " ';' expected"
and I have the ';' everywhere.

If you have any idea how to translate this script to JavaScript, please tell me!!!

Thanks in advance!
Lallo

vinyl-junkie
03-19-2007, 04:45 PM
What you have here is a database connection script. That is server side scripting. Javascript is client side scripting. You can't rewrite this script into javascript.

Is there more to this than you're telling us? What specific problem are you trying to solve?

Lallo
03-19-2007, 05:39 PM
Problem solved, thanks again!!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum