Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 01-30-2009, 06:28 PM   #1
dasmin5
Registered User
 
Join Date: Apr 2008
Location: Midwest
Posts: 2
Default Simple SQL Server Connection Problem

I have created a login/registration system. I have setup the database in SQL server 2008 Pro. I setup the security permssision for the database. I also, setup the SQL Config manager to use Tcp 1433. When I run the app it opens fine on the internet which the app is using ASP.Net. What the heck could I be messing up?

Simple SQL Server Connection
I put in my info that I setup for the database:server name(localhost), Database name(testdb), usernameflexUser), and the password.
When I hit test connection it says:

"Unable to connect to the database"
java.sql.SQLException: Login failed for user 'flexUser'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnos tic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(Td sCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.ja va:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(C onnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(C onnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.ja va:178)
at org.eclipse.datatools.connectivity.db.generic.JDBC Connection.createConnection(JDBCConnection.java:87 )
at org.eclipse.datatools.connectivity.DriverConnectio nBase.internalCreateConnection(DriverConnectionBas e.java:104)
at org.eclipse.datatools.connectivity.DriverConnectio nBase.open(DriverConnectionBase.java:53)
at org.eclipse.datatools.connectivity.db.generic.JDBC ConnectionFactory.createConnection(JDBCConnectionF actory.java:52)
at org.eclipse.datatools.connectivity.internal.Connec tionFactoryProvider.createConnection(ConnectionFac toryProvider.java:77)
at org.eclipse.datatools.connectivity.internal.Connec tionProfile.createConnection(ConnectionProfile.jav a:354)
at com.adobe.datatools.derived.wizards.BaseConnection ProfilePage.testConnectionSimple(BaseConnectionPro filePage.java:70)
at com.adobe.datatools.derived.wizards.BaseConnection ProfilePage.testConnection(BaseConnectionProfilePa ge.java:51)
at org.eclipse.datatools.connectivity.ui.wizards.Conn ectionProfileDetailsPage$1.widgetSelected(Connecti onProfileDetailsPage.java:85)
at org.eclipse.swt.widgets.TypedListener.handleEvent( TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3293)
at org.eclipse.jface.window.Window.runEventLoop(Windo w.java:820)
at org.eclipse.jface.window.Window.open(Window.java:7 96)
at com.adobe.flexbuilder.dbwizard.ui.DbWizard$8.widge tSelected(DbWizard.java:598)
at org.eclipse.swt.widgets.TypedListener.handleEvent( TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3293)
at org.eclipse.jface.window.Window.runEventLoop(Windo w.java:820)
at org.eclipse.jface.window.Window.open(Window.java:7 96)
at com.adobe.flexbuilder.dbwizard.actions.DBWizardAct ion.run(DBWizardAction.java:69)
at org.eclipse.ui.internal.PluginAction.runWithEvent( PluginAction.java:256)
at org.eclipse.ui.internal.WWinPluginAction.runWithEv ent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.ha ndleWidgetSelection(ActionContributionItem.java:54 6)
at org.eclipse.jface.action.ActionContributionItem.ac cess$2(ActionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5. handleEvent(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Wor kbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workben ch.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench. java:466)
at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
at com.adobe.flexbuilder.standalone.FlexBuilderApplic ation.start(FlexBuilderApplication.java:112)
at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 106)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework( Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:11 73)
at org.eclipse.equinox.launcher.Main.main(Main.java:1 148)
dasmin5 is offline   Reply With Quote
Old 01-31-2009, 05:44 AM   #2
drkstr
Flexpert
 
drkstr's Avatar
 
Join Date: Sep 2006
Location: Seattle, WA: USA
Posts: 1,587
Default

I don't understand, are you creating an AIR app or trying to expose your server side database to a client side application? If the later, you shouldn't/can't connect to the data base directly. You should use a proxy service (some kind of http script or data service) to handle the connection for you, then send the data back in a format the application will use.


Best Regards,
~Aaron
drkstr is offline   Reply With Quote
Old 02-03-2009, 02:21 AM   #3
dasmin5
Registered User
 
Join Date: Apr 2008
Location: Midwest
Posts: 2
Default

It's just a simple login/registration. I have a whole website already put together with login/registration, etc. But I did that with Dreamweaver, SQL Server 2008, and Visual Studio 2008. I am new to Flex, so I was just trying to do the same thing with Flex.

I have the "Adobe Flex 3 training from the source" book, but it is not really telling much about setting up something for a login w/registration. I am more of a visual person, but I thought the book would help me.

And to reinterate, on the first problem. I created a database first in SQL 2008(not the express ver.). Then I created what I thought was a Flex App w/ASPNet. The Flex App opened fine.. So I made sure I setup all the permissions for the SQL 2008 database. Then I went to Data->Create App from database->New Connection->Name->. From there I am at the "Simple SQL Server Connection" page. And then comes the long error; that I posted before. Sorry, I am trying to sum this up. But, after that I opened up my Flex app in Visual Studio '08. Worked fine there. So I from there I tinkered with the web config, and even setup persmissions that way. To no surprise, I am still at square one.

Hope you have enough information this time.

Thanks
dasmin5 is offline   Reply With Quote
Old 02-03-2009, 07:43 PM   #4
drkstr
Flexpert
 
drkstr's Avatar
 
Join Date: Sep 2006
Location: Seattle, WA: USA
Posts: 1,587
Default

Ok, I think I understand what's going on. You should have some kind of gateway that you send information to through POST or GET. I'm not sure how you would configure this in Visual Studio, but on the flex side you would do something like this:

ActionScript Code:
var loader:URLLoader = new URLLoader(); var postVars:URLVariables = new URLVariables(); postVars.userName = "foo" postVars.userPass = "bar" request.method = URLRequestMethod.POST; request.data = postVars; loader.addEventListener(Event.COMPLETE, completeHandler ); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler ); loader.load( new URLRequest( "http://www.domain.com/login.php" ) );

or this:

Code:
    <mx:HTTPService id="userRequest" url="http://domain.com/login.php" useProxy="false" method="POST">
        <mx:request xmlns="">
            <userName>foo</userName>
            <userPass>bar</userPass>
        </mx:request>
    </mx:HTTPService>
Then on the server side script you would check the credentials in the DB and send back some kind of response your app can understand (usually XML).

Make sense?


Best Regards,
~Aaron
drkstr is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with camera and wowza server (camera wont display) fastwings Flex 2, 3 & 4 0 11-03-2008 12:35 PM
Flash Media Server 2... trying to stream a simple video BradThor Flash Media Server 3 10-09-2006 01:30 PM
Basic: SQL Connection flashrm2 Server-Side Scripting 8 02-24-2005 05:08 PM
weird problem - flash not working on host machines, but works on local server matt poole Server-Side Scripting 7 09-25-2003 06:59 AM
seperate server problem with flash message board sonic_2k_uk Server-Side Scripting 4 09-21-2003 02:23 PM


All times are GMT. The time now is 11:58 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.