scott_hollen
3rd February 2011, 02:17
Hey all --
I'm very, very adverse to posting questions on technical forums mainly because I like to figure things out myself, but with the project I'm currently working on and the time constraints it presents, I must throw questions out and subject myself to the abuse I might endure as a result :) Trust me I've tried to figure this out...
Is there any way with Qt's libraries to ping a SQLite database for it's existence prior to creating it? SQLite will try to create a db if it doesn't exist but I don't want that to happen -- it looks like there's ways to do it with their libraries but as of a few days ago I'd prefer to stay with the Qt ones...I'm trying to perform the following and the first line is the keystone...
if (DB doesn't exist) then
if (username/password is the default administrator pairing) then
go to the Admin form for DB and user creation
else
display Not Authorized-type error message and kick 'em out
end if
else /* DB does exist */
verify user credentials by querying DB
If (not authorized) then
display Not Authorized-type error message and kick 'em out
else
set up proper roles for this user
end if
end if
If I've overlooked something in my searched, please be kind :)
scott
looks like I lost my formatting -- sorry!
I'm very, very adverse to posting questions on technical forums mainly because I like to figure things out myself, but with the project I'm currently working on and the time constraints it presents, I must throw questions out and subject myself to the abuse I might endure as a result :) Trust me I've tried to figure this out...
Is there any way with Qt's libraries to ping a SQLite database for it's existence prior to creating it? SQLite will try to create a db if it doesn't exist but I don't want that to happen -- it looks like there's ways to do it with their libraries but as of a few days ago I'd prefer to stay with the Qt ones...I'm trying to perform the following and the first line is the keystone...
if (DB doesn't exist) then
if (username/password is the default administrator pairing) then
go to the Admin form for DB and user creation
else
display Not Authorized-type error message and kick 'em out
end if
else /* DB does exist */
verify user credentials by querying DB
If (not authorized) then
display Not Authorized-type error message and kick 'em out
else
set up proper roles for this user
end if
end if
If I've overlooked something in my searched, please be kind :)
scott
looks like I lost my formatting -- sorry!