PDA

Click to See Complete Forum and Search --> : Data.recordsource sql is empty


Caro
Oct 24th, 1999, 10:28 PM
Can anyone tell me the best way to check via an sql if a record exists on my database and to create it if it doesnt? I do
datax.recordsource = sql but then when I test for EOF or Refresh I get an error if its not there ? Help! If its not there I need to create a new record - thanks

smalig
Oct 25th, 1999, 12:41 AM
Try it,

Data1.DatabaseName = "d:\db1.mdb"
Data1.RecordSource = "SELECT * FROM table1 WHERE id=3"
Data1.Refresh

if Data1.Recordset.RecordCount=0 then
...
else
...
endif

------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)