Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Connection String in a Connection Object
Message
De
05/11/1998 13:46:00
 
 
À
05/11/1998 12:53:02
Robert Byrd
National Association of Homebuilders
Washington, District de Colombia, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00154910
Message ID:
00154946
Vues:
17
Hiya Bob ---

Your problem is that you are using the object "l_oConnection" where the SQLPREPARE function is expecting a numeric connection number. The CREATEOBJECT function is creating an instance of cusConObj, *not* returning the return value from the Init as you may expect. Try creating a custom property in cusconobj named connnumber and populating it with the connection number in Init. Then after creating l_oConnection, call SQLPREPARE with l_oConnection.connnumber.



>I have created a connection object cusConnObj whose INIT code is...
>
>
>CREATE DATA worktbls\dataconn
>
>CREATE CONNECTION nConVar CONNSTRING &p_cConnString
>g_oApp.r_nConVar = SQLCONNECT('nConVar')
>
>RETURN g_oApp.r_nConVar
>
>
>...where r_cVonVar is a property in my application object and p_cConnString is a valid SQL Server connection string.
>
>I call this from a reporting procedure as follows...
>
>
>SET CLASSLIB TO LM2CUSTOM ADDITIVE
>l_oConnection=CREATEOBJECT("cusConnObj")
>
>=SQLPREPARE(l_oConnection,"Select l.li_name, g.gn_desc, count(nl.na_liid) cnt from name n, namelist nl, list l, gender g where n.na_id = nl.na_id and nl.na_liid *= l.li_id and n.na_gender *= g.gn_id GROUP BY l.li_name, g.gn_desc","_temp")
>
>
>... which results in an error : "Function argument value, type or count is invalid."
>
>What's wrong with this picture?
>
>Bob
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform