I'm makign a program, for create account, edit and more ..
I started with create acouunt.
and i wanna check when i create account.
If the account already exist. and he is i'll send message or someing ..
I check in SQL Server 2005 this execute:
Just way to check if this account exist ..PHP Code:if exists (select 'idohadar' from [Account] where [UserID] = 'idohadar')
begin
select 'Ido' from [Account] where [Name] = 'Ido'
end
In my C++ Program i used in this func to execute (ODBC):
But I don't know what the 'RetCode' should return if its exist or not, i tried the all returns .. (SQL_SUCCESS, SQL_SUCCESS_WITH_INFO and the others ..)PHP Code:sprintf(String, "if exists (select 'idohadar' from [Account] where [UserID] = 'idohadar')");
strcpy((char*)SqlQuery, String);
RetCode = SQLExecDirect(hStmt, SqlQuery, SQL_NTS);
if(RetCode)
{
MsgBox("Exist");
}
else
{
MsgBox("Not Exist");
}
Any idea :D ?


Reply With Quote


