|
|||
|
dear support,
i have this trouble when i tried to build my apps using SWFKit Pro 3.2, i used xampp for mysql and Flash CS3 pro .. it run well if i preview my apps using swfkit_preview on the command flash menu, but not if i tried to Build or Test from SWFKit menu.. swfkit_testapp flash command also not working here's my init script Code:
//Initialize
getAdditionalFile();
//Application.registerASMethods("");
function boxHandler(str, type) {
Dialogs.msgBox(str, "", type);
}
var conn = new ActiveXObject("ADODB.Connection");
conn.connectOK = false;
conn.ConnectComplete = function (err, status, cnt) {
if (typeof err != "undefined") {
boxHandler(err.Description, 16);
return false;
} else {
//boxHandler("Connect complete!", 64);
conn.connectOK = true;
}
//boxHandler("status: ", status.value);
}
var connStr = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost; DATABASE=diskes;UID=root;PWD=root";
conn.open(connStr);
if (!conn.connectOK) {
boxHandler("Failed to connect to the DB", 16);
return false;
} else {
//boxHandler("database connected", 64);
//conn.close;
return true;
}
how can i compile my apps with this kinda problem?? please help ... fyi: my os is windows xp x64 proffessional and im using mysql-connector-odbc-5.1.4 for winx64 best regards, |
|
|||
|
Since it works in preview mode, it will also work when you build an exe file, unless some external files cannot be accessed by the exe file. Can you please tell us what happened when you used the "build" command? Thank you very much.
|
|
|||
|
thanks for your reply'
the build command return with no error.. but when i tried to open my compiled files, the popup dialog "Failed to connect to the DB" always shown, indicates that the program cannot connect to the database .. strangely, it works fine only if i used swfkit_preview from the command flash menu' i also tried to open my apps from windows temporary files (after i used swfkit_preview), but it won't work either .. helppp' :`( |
|
|||
|
Don't know if this willl work, but I had a similar problem when calling a php script on a site from flash
When calling it from flash and preview directly it worked when calling if from a swfkitprojector it failed when the projector was packed with the application Maybe it's something with security settings, Could be a coincidence but it worked when i changed this: http://www.macromedia.com/support/do...manager04.html For some reason the checkbox was selected to deny all access |
|
|||
|
thanks for your reply meester,
but.. it still didn't work either :'( the checkbox was selected to "always ask" and i change the checkbox to "always allow".. but still' it might not relevance because i try to build stand alone application without any interaction with web browser, but thanks anyway.. |
|
|||
|
update::
dear support, please explain the simplest way to connect to MySQL database .. i'm currently using MySQL service and Connector from http://dev.mysql.com/downloads/connector/odbc/, i also have tried all version (ODBC 3.51 and 5.1) using this script: Code:
//Initialize
getAdditionalFile();
function boxHandler(str, type) {
Dialogs.msgBox(str, "", type);
}
var conn = new ActiveXObject("ADODB.Connection");
conn.connectOK = false;
conn.ConnectComplete = function (err, status, cnt) {
if (typeof err != "undefined") {
boxHandler(err.Description, 16);
return false;
} else {
boxHandler("Connect complete!", 64);
conn.connectOK = true;
}
//boxHandler("status: ", status.value);
}
var connStr = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost; DATABASE=db;UID=root;PWD=root";
conn.open(connStr);
if (!conn.connectOK) {
boxHandler("Failed to connect to the DB", 16);
return false;
} else {
boxHandler("database connected", 64);
//conn.close;
return true;
}
![]() |
|
|||
|
owh ..
my project is almost done.. all i have to do is to compile it.. ??? i tried to migrate the database to firebird, since sql command is the same.. is it? but its confusing, it seems the query isn't compatible with standard query exported from phpmyadmin.. any idea? |
|
|||
|
We've found out that the method of checking the database connection isn't reliable. After removing the following code
Code:
if (!conn.connectOK) {
boxHandler("Failed to connect to the DB", 16);
return false;
} else {
boxHandler("database connected", 64);
//conn.close;
return true;
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|