Retrieving data from an access database and show it to the user.
-
Hi, I'm having a problem retrieving a data from an access database and put it into a textbox. I tried to code it but it didn't worked. here's my code:
function search()
{
try{
var connection = new ActiveXObject("ADODB.Connection");var rs = new ActiveXObject("ADODB.Recordset");
connection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\IT114P\\Week2-Hibaler\\regform.mdb");
rs.Open("select emailAddress from RegFormTable where emailAddress = '"+document.regpage.emaildelete.value+"';", connection);
rs.MoveFirst;
while(!rs.eof)
{
document.regpage.email.value = rs.fields(0);
rs.MoveNext;}
rs.close;
conec
}
catch(e)
{
alert(e);
}
}When I use this code I always get an ObjectError message. I don't know where or what's the problem with the code. Can anyone help me?
-
Hi, I'm having a problem retrieving a data from an access database and put it into a textbox. I tried to code it but it didn't worked. here's my code:
function search()
{
try{
var connection = new ActiveXObject("ADODB.Connection");var rs = new ActiveXObject("ADODB.Recordset");
connection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\IT114P\\Week2-Hibaler\\regform.mdb");
rs.Open("select emailAddress from RegFormTable where emailAddress = '"+document.regpage.emaildelete.value+"';", connection);
rs.MoveFirst;
while(!rs.eof)
{
document.regpage.email.value = rs.fields(0);
rs.MoveNext;}
rs.close;
conec
}
catch(e)
{
alert(e);
}
}When I use this code I always get an ObjectError message. I don't know where or what's the problem with the code. Can anyone help me?
Is there an "E" drive on the client? This won't work when the database is on a server. You might also take note that JavaScript can be downloaded and opened by anyone in the same way that one downloads HTML. That means that other people can see your connectionstring and open the database/make changes as they see fit.
I are Troll :suss:
-
Hi, I'm having a problem retrieving a data from an access database and put it into a textbox. I tried to code it but it didn't worked. here's my code:
function search()
{
try{
var connection = new ActiveXObject("ADODB.Connection");var rs = new ActiveXObject("ADODB.Recordset");
connection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\IT114P\\Week2-Hibaler\\regform.mdb");
rs.Open("select emailAddress from RegFormTable where emailAddress = '"+document.regpage.emaildelete.value+"';", connection);
rs.MoveFirst;
while(!rs.eof)
{
document.regpage.email.value = rs.fields(0);
rs.MoveNext;}
rs.close;
conec
}
catch(e)
{
alert(e);
}
}When I use this code I always get an ObjectError message. I don't know where or what's the problem with the code. Can anyone help me?
I have an code that i use to retrive data from access DB and to show into textbox. <% try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:OBS","",""); } catch(Exception e) { out.println(e);} if(con!=null) { try { Statement statement = con.createStatement(); ResultSet rs = statement.executeQuery("SELECT * from userform where srno='"+id+"'"); while(rs.next()) { n=n+1; %> <input type="text" name="fname" value="<%=rs.getString(2)%>" width="15" />
-
Hi, I'm having a problem retrieving a data from an access database and put it into a textbox. I tried to code it but it didn't worked. here's my code:
function search()
{
try{
var connection = new ActiveXObject("ADODB.Connection");var rs = new ActiveXObject("ADODB.Recordset");
connection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\IT114P\\Week2-Hibaler\\regform.mdb");
rs.Open("select emailAddress from RegFormTable where emailAddress = '"+document.regpage.emaildelete.value+"';", connection);
rs.MoveFirst;
while(!rs.eof)
{
document.regpage.email.value = rs.fields(0);
rs.MoveNext;}
rs.close;
conec
}
catch(e)
{
alert(e);
}
}When I use this code I always get an ObjectError message. I don't know where or what's the problem with the code. Can anyone help me?