//connection to DB
on connectToDB
put the dbhost of me & ":" & the dbport of me into tHost
put revOpenDatabase(the dbtype of me,tHost,the dbname of me,the dbUser of me, the dbPasswd of me) into tConxn
# it's a good idea, but not required, to check for a successful connection here
if tConxn is a number then
put tConxn into gConnID
return empty
else
put "Unable to connect to database '" & the dbName of me & "': " & tConxn into tErrMsg
answer error tErrMsg as sheet
put empty into gConnID
return tErrMsg
exit to top
end if
end connectToDB
//disconnect from DB
on closeDB pConnID
revCloseDatabase pConnID
# this ensures that you'll never have a left-over connection number in the global var
if pConnID = gConnID then
put empty into gConnID
end if
end closeDB
i use the code above but i cant connect to the database. it returns error
thanks for your help
CHeers





