I cannot figure out why I cannot get a valid handle for a connection I am able to establish in Command Window as well as in a method. The question mark statement consistently returns -1 which means: no handle (error).
OPEN DATABASE ("D:\vfp_Projects\Data\d_data\histdata.dbc")
CREATE CONNECTION Myconn DATASOURCE "MyFoxSQLNT" USERID "Administrator" PASSWORD ""
IF EMPTY (DBGETPROP ("Myconn","CONNECTION","ConnectString"))
myUserID = 'Administrator'
myPassword = ""
STORE SQLSTRINGCONNECT ('dsn=MyFoxSQLNT;uid=myUserID;pwd=myPassword') TO gnConnHandle
The connection is being established because otherwise I would have gotten an error at DBGETPROP statement.
Thanks for any help. I am sure it is a simple one for experts.