Why not use AERROR() to see why the SQLSTRINGCONNECT() not works?
.Datasource=SQLSTRINGCONNECT(mysqlconnstr)
IF .DataSource < 0
AERROR(aErr)
MessageBox(aErr[1,2])
ENDIF
BTW If You want to connection string not to be hard coded why you put it in header file? Why not write it in registry, INI file, table or somewhere else where you can reach it? If You inculde it in Header or #define it you must recompile the entire application each time if the server is changed or any in other changes in connection string.
>I am trying to remove the "hard coded" .Datasource connection string from my Cursor Adaptor. I would like to use a #DEFINE inside an #INCLUDE file, but it doesn't seem to work. I have included the .h file in the class and other #defines in that .h file are working but when I use
>
>.Datasource=SQLSTRINGCONNECT(mysqlconnstr)
>
>the data does not connect.
>
>My .h file has a line with :
>
>#DEFINE mysqlconnstr "driver=sql server;server=webdev;database=shareddata;uid=UID;pwd=pwd"
>
>This conn string works fine inside SQLSTRINGCONNECT
>
>thanks
>
>bonnie
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.