View Single Post
Old Dec 6th, 2007, 1:17 AM   #2
venkatramasamy
Newbie
 
Join Date: Oct 2007
Location: INDIA
Posts: 19
Rep Power: 0 venkatramasamy is an unknown quantity at this point
Send a message via AIM to venkatramasamy
Post Re: Searching A Record

HI Tau,

The details you furnished is not sufficient to guide you on right direction, the reason no information provided about the direction you want to go,

just tell me what database you are using like MS access, Oracle, SQLServer

Usually beginers use MS access...

if it so...

i assumed that there exists an Db named as MYDB.Mdb
create the database base connection
dim cn as new Adodb.Connection
dim rs as new adodb.recordset
dim strfound as boolean
cn.open (Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DBQ=C:\MYDB.mdb;DefaultDir=C:\;Driver={Driver do Microsoft Access (*.mdb)};DriverId=281;FIL=MS Access;FILEDSN=C:\MYDB.mdb.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;")

rs.open "select *from samp"
Strfound=false
if rs.reordcount>0 then
     rs.movefirst
      For i=0 to rs.recordcount-1
     if strcmp(rs.fields(fileldindex),searchvale,vbtextcompare)=true then
    strfound=true          
end if
      rs.movenext
Next      


end if

if strfound=true then
msgbox "Record Found"
else
msgbox "Record Not Found"

i hope the code will help

the code above furnishes was not cheked it simple guide line only you may need to make slight changes on it

all the best

With regards
venkatramasamy SN

Last edited by cscgal; Dec 6th, 2007 at 3:35 AM. Reason: Code tags
venkatramasamy is offline   Reply With Quote