Gathering info from SQL Database

Avatar

08-10-2008

I want to my users to be able to enter an account number and it return name and address. I have created the Dataconnection and set it to delayed open. The sequal command that i am using is "select * from memb where acct = '" I have it set as an exit command currently but can change it if i need to. It is running on a server and as a formcalc. Do I need to Bind the name and address field to my data connection name and address?

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

08-10-2008

Yes you need to bind the results of your query to the fields on your form.

Avatar

08-10-2008

I keep getting a "Couldn't post data to", Here the script from... What is wrong???



topmostSubform.Page1.P.acct::exit - (FormCalc, server)



xfa.sourceSet.DataConnection.nodes.item(1).query.setAttribute = "text"

xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value = "Select * from memb where acct = '", this.rawValue, "'")

//app.alert(xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value);



//now connect to DB and get a record

//xfa.sourceSet.DataConnection.open()

//xfa.host.messageBox ("Data Connection Opened")

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

08-10-2008

You have your code set to run server side but you are not rendering from a server. Change it to run client side.

Avatar

09-10-2008

Okay, I have changed to client and when i Check my script syntax it is not liking this field. Do I need to have it set on formcalc or javascript?



xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value = "Select * from memb where acct = '" + this.rawValue +

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

09-10-2008

javascript