Click here to Skip to main content
15,918,404 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
I have a MS Access database named result.mdb
My code in VBScript is here :

"In the bold part is error part but it works fine in IE but through error in crome, mozila ect"


<%
opt_b = request("batch")
Dim con,rec,path,sql,vpath,cons,reca
Set con = Server.CreateObject("ADODB.Connection")
path = "re_result.mdb"
vpath = Server.MapPath( path )
cons = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & vpath & ""
con.open cons
Set rec_name = Server.CreateObject("ADODB.Recordset")


SQL
if(opt_b = "") then
'response.write("No batch available for this course")
else
         sql_tbl_n = "select table_name from Master_Record where course='"& opt_c &"' and batch_code='"& opt_b &"'"
         rec_tbl_n.Open sql_tbl_n,con
         if rec_tbl_n.bof or rec_tbl_n.eof then
     response.write "no records."
         else
            rec_tbl_n.movefirst
            tbl_name = rec_tbl_n(0)
                'response.write(tbl_name & "<br>")
         end if


sql_name = "select Name, Roll_No from " & tbl_name & " group by Name, Roll_No "rec_name.Open sql_name,con
if rec_name.bof or rec_name.eof then
n_flag = 0
else

n_flag = 1
rec_name.movefirst
end if
%>
Posted

1 solution

You are using VBScript which is supported only by IE. No other browser supports VBScript.
 
Share this answer
 
Comments
Manojkushwaha 22-Jul-11 3:14am    
is any other way to solve this because i m using ASP with Access database
[no name] 22-Jul-11 3:24am    
Hold on, I just noticed that this is Server side script and not client side, so browser should not matter. What is the error that you are getting?
Manojkushwaha 25-Jul-11 3:27am    
In the above code I had marked the bold text " & tbl_name & " where i got the problem. its work fine in IE but does not support in crome and mozila...
[no name] 25-Jul-11 14:15pm    
ASP code runs in the server, not the browser. So, it doesn't matter if it is IE or Firefox. I do not understand what you are talking about.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900