Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters

Status
Not open for further replies.

tgerits

Programmer
Oct 5, 2001
23
BE
Hi,

I am using VFP 6.0. I have created a class with some functions. One of the functions is 'addCustomer' with following code:

Code:
LPARAMETER cust_Name,cust_Address
strConnect="driver={SQL Server};..."
nConnectionHandle=SQLSTRINGCONNECT(strConnect)
xyz=SQLEXEC(nConnectionHandle,"execute addCustomer '" + cust_Name + "','" + cust_Address + "'","myCursorName")

SQLDISCONNECT(nConnectionHandle)[\code]

When I click a button in the form where i have put the class,the function has to be called:
[code]thisform.testSQL1.addCustomer("...","...")[\code]

When I pass the parameters, in the form it's correct.  But when I print them from the method in the class they are always empty?  Does anyone know what the problem is?

Thanks!!!
 
thisform.testSQL1.addCustomer("...","...")

if you are passing data from a textbox

thisform.testSQL1.addCustomer(alltrim(thisform.textbox1.value),alltrim(thisform.textbox2.value))

are are only going to use quotes if your data is litreal

thisform.testSQL1.addCustomer("manualinput","7009 mystreet")


if using a var

thisform.testSQL1.addCustomer(var1,var2)

NOTE: always test your parameters for valid data

check function PARAMETERS() to test for quanity

then use TYPE() OR VARTYPE() to check if var is type expected.


Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top