Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-29-2007, 07:06 PM
Junior Member
 
Join Date: Mar 2007
Posts: 3
Default Cant retrieve records

Hi guys!!

First off great software and great forum!!

I tried creating a sample application. It was setup this way.

Database: MS SQL Server 2005 Express Edition

Flash frontend:
textbox1 named 'connstr'
textbox2 named 'msgs'
textbox3 named 'infos'
button1 --> fscommand("FFish_Run", "dologin");
button2 --> fscommand("FFish_Run", "displayinfo");


FFish Scripts
Code:
//dologin
var conn = new ActiveXObject("ADODB.Connection");

var pla = new FlashPlayer;
pla.bindData("connstr.text");
pla.updateData(true);

var str = pla.connstr.text;
FlashPlayer.setVariable("_root.msgs",str);

var connected = false;
conn.ConnectComplete = function (err, arg1, arg2)
{
   if (err != undefined)
   {
      FlashPlayer.setVariable("_root.msgs",err.Description);
      return;
   }
   connected = true;
}

//Contect to the database
conn.open(str);
if (!connected){
FlashPlayer.setVariable("_root.msgs","Failed to connect to the DB");
return;
}else{
FlashPlayer.setVariable("_root.msgs","Successfully Connected!!");
return;
}
<---------------------->
Code:
//displayinfo
var rs = new ActiveXObject("ADODB.Recordset");
rs.open("Select * from testb", conn, 1, 2);
rs.moveFirst();
var testmsg=rs.Fields["name"].Value;
FlashPlayer.setVariable("_root.infos", testmsg);
Please guys need your help... i need to get this working :'(


PS. What Connection String should i use to connect to SQL Server 2005 Express Edition
Reply With Quote
  #2 (permalink)  
Old 03-30-2007, 12:34 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Cant retrieve records

The following web page explains how to use connection strings:

http://www.asp101.com/articles/john/...ng/default.asp

The connection string for sql server 2005 should be something like

"Provider=SQLOLEDB; Data Source=localhost; Initial Catalog=mydb; User ID=username; Password=password;"
Reply With Quote
  #3 (permalink)  
Old 03-30-2007, 01:02 PM
Junior Member
 
Join Date: Mar 2007
Posts: 3
Default Re:Cant retrieve records

Tnx for the quick reply

So there isnt anything wrong with the code im using?

What if im using windows authentication? Could i just leave out the User name and Password parameters?(the link you gave me didnt say)
e.g
"Provider=SQLOLEDB; Data Source=localhost; Initial Catalog=mydb;"


Tnx for the help so far and pardon me being a noob at this
Reply With Quote
  #4 (permalink)  
Old 03-30-2007, 01:26 PM
Junior Member
 
Join Date: Mar 2007
Posts: 3
Default Re:Cant retrieve records

i tried this connection string and it gave me a
'Failed to connect to db' message

"Provider=SQLOLEDB; Data Source=\\BINARYMACS\SQLEXPRESS; Integrated Security=True; Initial Catalog=MissionsDB;"
Reply With Quote
  #5 (permalink)  
Old 03-30-2007, 01:44 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Cant retrieve records

Please try the method introduced in the following article:
http://support.microsoft.com/default...b;en-us;265808
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 04:11 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.