decoy General User

Joined: 11 Aug 2003 Posts: 5 Location: Netherlands, Rotterdam
|
Posted: Mon Aug 11, 2003 5:11 am Post subject: [Postgres - ODBC - Windows 2k] Get specific data from DB |
|
|
HEllo ppl,
I'm trying to get some specific data from a database so I can auto-create a letter and/or fax.
I have the folowing code.
| Code: |
'Gegevens opvragen
InputVal = InputBox("Nummer:", "Nummer", "")
'Ons Select statement
Statement = Connection.createStatement()
ResultSet = Statement.executeQuery("SELECT * FROM public.overzich WHERE overzich.field5 = InputVal LIMIT 1")
|
the problem lies in:
| Code: |
("SELECT * FROM public.overzich WHERE overzich.field5 = 'InputVal' LIMIT 1")
|
SELECT * FROM public.overzich LIMIT 1 ; Works fine, but i want to use the value from the inputbox.
I tried the following but they all failed:
| Code: |
("SELECT * FROM public.overzich WHERE overzich.field5 = InputVal LIMIT 1")
("SELECT * FROM public.overzich WHERE overzich.field5 = 'InputVal' LIMIT 1")
("SELECT * FROM public.overzich WHERE overzich.field5 = ''InputVal'' LIMIT 1")
("SELECT * FROM public.overzich WHERE overzich.field5 = "InputVal" LIMIT 1")
("SELECT * FROM public.overzich WHERE overzich.field5 = ", InputVal, " LIMIT 1")
|
Can anyone tell me how to use the variable from the inputbox in the select-statement?
I couldn't find anything with the search or in documents I found on the web. |
|