Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2008, 04:35 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Problem connecting MySQL service

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;
}
as it write on the script, it always failed to connect the database if i'm using other than swfkit_preview command
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,
Reply With Quote
  #2 (permalink)  
Old 11-03-2008, 09:35 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Problem connecting MySQL service

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.
Reply With Quote
  #3 (permalink)  
Old 11-04-2008, 11:31 PM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Re: Problem connecting MySQL service

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'

:`(
Reply With Quote
  #4 (permalink)  
Old 11-06-2008, 06:01 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re: Problem connecting MySQL service

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
Reply With Quote
  #5 (permalink)  
Old 11-08-2008, 06:45 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Re: Problem connecting MySQL service

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..
Reply With Quote
  #6 (permalink)  
Old 11-09-2008, 09:39 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Re: Problem connecting MySQL service

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;
}
the problem is just the same, it only connected to the database if i use swfkit_preview from flash.. otherwise ADODB is connected but not the database
Reply With Quote
  #7 (permalink)  
Old 11-10-2008, 06:59 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Problem connecting MySQL service

We've made the problem recur, and are now working on it. We'll get back to you when a solution has been found. Thank you.
Reply With Quote
  #8 (permalink)  
Old 11-11-2008, 08:23 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Re: Problem connecting MySQL service

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?
Reply With Quote
  #9 (permalink)  
Old 11-11-2008, 09:47 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Problem connecting MySQL service

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;
}
, the program works well under both "preview" and "build" mode. That is to say, an error during the connecting process doesn't necessarily mean the connection hasn't been built successfully. Now the problem is to find out a reliable connection checking method.
Reply With Quote
  #10 (permalink)  
Old 11-11-2008, 11:50 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default Re: Problem connecting MySQL service

thanks god'.. and thanks for your support, looking forward for the latest release of your application teams' ..

best regards
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:25 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.