Is 'Syspro' a Connection name or DataSource name?
>I'm linking to an ODBC database - (Syspro)
>
>The connect command is
>h=sqlconnect('Syspro','dba','')
>
>This works wonderfully in the command window. It works in a program (prg file)
>
>However if the same line is in code it fails with the following error. (returned by aerror)
>
>DIAG [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
>
>How can it work in the command box,a program, but not in a form. (It is supposed to work in a form...
>
>BTW I've tried it in VFP7 AND VFP9 as well and it has the same problem... works in the command box or a program, but not in a form.
>
--sb--