>Kevin,
>
>Thanks.
>No typos it compiles perfectly!
>
>when I run it it gives an error, though
>SQL State = '2800'
>SQL Error = 18456
>
>then it opens a dialog where when I check the trusted connection it works with sa,no password as well my windows login/password
>how can I get around this??
>
>
Keep in mind - Trusted Connection=yes means you are using windows authentication using your current windows login. you do not specify username and password if you are using Trusted Connection=Yes.
To use SQL authentication (your sa account or others) you specify username and password in the connection string, and you do not include the Trusted Connection stuff.
>Peter
>
>
>
>>Once you get passed the hump, it all gets pretty easy in VFP to access SQL*Server Data. Here is a quick example In its simplest form using a connectionstring (not the cursor adapter thing): (Note: I didn't test it, so there are probably errors in the text below!)
>>
>>******************************************************************
>>strConnectionString = [Driver={SQL Server};Server=ServerNameHere;Database=YourDatabase;Uid=user_id;pwd=password]
>>strSQL = "select * from Names where intPK = '1' " && or what ever sql statement you are passing.
>>csrCursorToBeReturned ="csrNames"
>>intHandle = SQLSTRINGCONNECT(strConnectionString)
>>intResults = SQLEXEC(intHandle, strSQL, csrCursorToBeReturned)
>>
>>***************************************************************************************************
>>You now have vfp cursor (csrNames) do play around with in pure VFP. ... and you can do updates and inserts and deletes the same basic way.
>>
>>Kevin
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________