DBlookup Javascript

Rebel7

Registered User.
Local time
Yesterday, 20:20
Joined
Feb 17, 2009
Messages
23
Hi Everyone,

I am trying to do a DBlookup with an access page using javascript.

What I would like to have is a textbox that queries the entry in the textbox against the database and pulls a msgbox saying "Entry in Database" and if not found "Entry not in Database."

I am very rusty with javascript and understand the basics and I would appreciate any assistance with this issue.

Thank you
 
You need to use ADO to do this and you will need to find the syntax on a javascript site since it may be different from vba syntax.
 
Thanks. I'll look into that.
 
Hi,

Does it have to be javascript? couldn't you use php?


regs


Nigel
 
Hi Nigel,

I'm actually trying vbscript as I find it easier to work with but I haven't really figured it out yet.

If you are familiar with vbscript, your assistance would be appreciated.

Thanks,
 
Hi

Where is the database? Is it local? On a server? Are you looking to check this over the Internet?

Bit more info would be helpful.

Vb can do this easily especially when it's local
.asp would work well across the Internet.
.php would also work across the Internet.

It all depends on what you want.

Regs

Nigel
 
Hi Nigel,

The database would be local.

So far I have tried using the following script template:

<SCRIPT language=vbscript>
<!--
Private Sub Button1_Click()


Dim sql1 As String
Dim sql2 As String

Dim Conn As ADODB.Connection
Dim RecSet As ADODB.Recordset
Set Conn = New ADODB.Connection
Set RecSet = New ADODB.Recordset

MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"=C:\VBAPP\WireDB.mdb"

Conn.Open
sql1 = txtSIN.Text
sql2 = "select * From Table1 Where SIN = "" & sql1""

RecSet.Recordset.Open sql2, Conn

txtSIN= RecSet("SIN")


RecSet.MoveNext


RecSet.Close
Conn.Close

Set RecSet = Nothing
Set Conn = Nothing

-->
</SCRIPT>

However, this gives me an expected end statement error.

Any suggestions?
 
Hi,

just an observation here.

you have set all of this up
Code:
Dim Conn As ADODB.Connection
Dim RecSet As ADODB.Recordset
Set Conn = New ADODB.Connection
Set RecSet = New ADODB.Recordset

and then you set this
Code:
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"=C:\VBAPP\WireDB.mdb"

and then you open this

Code:
Conn.Open
sql1 = txtSIN.Text
sql2 = "select * From Table1 Where SIN = "" & sql1""

and then you close this
Code:
RecSet.Close
Conn.Close

Set RecSet = Nothing
Set Conn = Nothing

So,

shouldnt you be setting this instead?
Code:
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"=C:\VBAPP\WireDB.mdb"

in your declarations, i cannot see anything set up called "MyConn" whereas "Conn" is used everywhere. is this your problem?


nigel
 
Hi,


Any advances on this? was it the problem?


Nigel
 

Users who are viewing this thread

Back
Top Bottom