View previous topic :: View next topic |
Author |
Message |
Senalaya
Joined: 29 Dec 2004 Posts: 82 Location: Germany
|
Posted: Fri Jan 28, 2005 23:33 Post subject: Connection Info |
|
|
Would it be possible, that SQLInit() would set an in-game variable, that stores the connection type (ODBC/MySQL/SQLite) and some version info in case of a successful initialization?
something like "NWNX!ODBC!INFO" with values like:
- "ODBC!v3!MSAccess"
- "MySQL!v4.1"
...
When the init fails, that var shouldn't exist. A simple "SELECT 1" could do the connection check.
The result could be used to select in-game the proper syntax for SQL commands like the "CREATE TABLE" statements. |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Jan 29, 2005 11:08 Post subject: |
|
|
Yes, good idea. I would recommend doing it like this:
* ODBC2 checks for a table (e.g.) "nwnxinfo" and creates it if it does not exist yet.
* ODBC2 puts all relevant information into columns in that table
* aps_include is extended with functions that query these columns (SELECT dbtype FROM nwnxinfo).
Anybody up for this ? _________________ Papillon |
|
Back to top |
|
|
NoMercy
Joined: 03 Jan 2005 Posts: 123 Location: UK
|
Posted: Sat Jan 29, 2005 16:55 Post subject: |
|
|
Definately a feature I'd be interested in, though I doubt I'd be the one for the job... mabie if I get NWNX to build sometime, but alas I don't know my way around the tools well enough :/ |
|
Back to top |
|
|
|