>SQLSETPROP(0,"DispLogin",1) >lnHandle = SQLCONNECT([DSNNameHere]) && The DSN should not contain username and/or password >* or lnHandle = SQLSTRINGCONNECT([Driver=SQL Server;DataBase=YourDB;Server=SomeServer]) >.... >>
OPEN DATABASE C:\sample\Data\myDBC.dbc PUBLIC lnConn lnConn = SQLCONNECT("myConn","sa","myPass") ?lnConn *:returns 1, so the connection succeeded SELECT 0 USE myDBC!myRemoteView *:here the login screen displays asking me for user and passNow, mybe I am mistaking, but isn't it supouse that the RV takes the opened connection when I performe this
lnConn = SQLCONNECT("myConn","sa","myPass")i think the only thing i have to do is to tell the Remote View to share the conection, right?
DBSetProp('ICLOC', 'View', 'ShareConnection', .T.)what i am missing?
CREATE CONNECTION ACCPACCON ; DATASOURCE "Sample" ; USERID "sa" ; PASSWORD "" **** DBSetProp('ACCPACCON', 'Connection', 'Asynchronous', .F.) DBSetProp('ACCPACCON', 'Connection', 'BatchMode', .T.) DBSetProp('ACCPACCON', 'Connection', 'Comment', '') DBSetProp('ACCPACCON', 'Connection', 'DispLogin', 1) DBSetProp('ACCPACCON', 'Connection', 'ConnectTimeOut', 15) DBSetProp('ACCPACCON', 'Connection', 'DispWarnings', .F.) DBSetProp('ACCPACCON', 'Connection', 'IdleTimeOut', 0) DBSetProp('ACCPACCON', 'Connection', 'QueryTimeOut', 0) DBSetProp('ACCPACCON', 'Connection', 'Transactions', 1) DBSetProp('ACCPACCON', 'Connection', 'Database', '') DBSetProp('ACCPACCON', 'Connection', 'PacketSize', 4096) DBSetProp('ACCPACCON', 'Connection', 'WaitTime', 100) ***************** View setup for ICLOC *************** CREATE SQL VIEW "ICLOC" ; REMOTE CONNECT "AccpacCON" ; AS SELECT Icloc.LOCATION, Icloc.ADDRESS1, Icloc.ADDRESS2, Icloc.ADDRESS3, Icloc.CITY, Icloc.STATE FROM dbo.ICLOC Icloc DBSetProp('ICLOC', 'View', 'UpdateType', 1) DBSetProp('ICLOC', 'View', 'WhereType', 3) DBSetProp('ICLOC', 'View', 'FetchMemo', .T.) DBSetProp('ICLOC', 'View', 'SendUpdates', .F.) DBSetProp('ICLOC', 'View', 'UseMemoSize', 255) DBSetProp('ICLOC', 'View', 'FetchSize', 100) DBSetProp('ICLOC', 'View', 'MaxRecords', -1) DBSetProp('ICLOC', 'View', 'Tables', 'dbo.ICLOC') DBSetProp('ICLOC', 'View', 'Prepared', .F.) DBSetProp('ICLOC', 'View', 'CompareMemo', .T.) DBSetProp('ICLOC', 'View', 'FetchAsNeeded', .F.) DBSetProp('ICLOC', 'View', 'Comment', "") DBSetProp('ICLOC', 'View', 'BatchUpdateCount', 1) DBSetProp('ICLOC', 'View', 'ShareConnection', .T.) DBSetProp('ICLOC', 'View', 'AllowSimultaneousFetch', .F.) *!* Field Level Properties for ICLOC * Props for the ICLOC.location field. DBSetProp('ICLOC.location', 'Field', 'KeyField', .T.) DBSetProp('ICLOC.location', 'Field', 'Updatable', .F.) DBSetProp('ICLOC.location', 'Field', 'UpdateName', 'dbo.ICLOC.LOCATION') DBSetProp('ICLOC.location', 'Field', 'DataType', "C(6)") * Props for the ICLOC.address1 field. DBSetProp('ICLOC.address1', 'Field', 'KeyField', .F.) DBSetProp('ICLOC.address1', 'Field', 'Updatable', .T.) DBSetProp('ICLOC.address1', 'Field', 'UpdateName', 'dbo.ICLOC.ADDRESS1') DBSetProp('ICLOC.address1', 'Field', 'DataType', "C(60)") * Props for the ICLOC.address2 field. DBSetProp('ICLOC.address2', 'Field', 'KeyField', .F.) DBSetProp('ICLOC.address2', 'Field', 'Updatable', .T.) DBSetProp('ICLOC.address2', 'Field', 'UpdateName', 'dbo.ICLOC.ADDRESS2') DBSetProp('ICLOC.address2', 'Field', 'DataType', "C(60)") * Props for the ICLOC.address3 field. DBSetProp('ICLOC.address3', 'Field', 'KeyField', .F.) DBSetProp('ICLOC.address3', 'Field', 'Updatable', .T.) DBSetProp('ICLOC.address3', 'Field', 'UpdateName', 'dbo.ICLOC.ADDRESS3') DBSetProp('ICLOC.address3', 'Field', 'DataType', "C(60)") * Props for the ICLOC.city field. DBSetProp('ICLOC.city', 'Field', 'KeyField', .F.) DBSetProp('ICLOC.city', 'Field', 'Updatable', .T.) DBSetProp('ICLOC.city', 'Field', 'UpdateName', 'dbo.ICLOC.CITY') DBSetProp('ICLOC.city', 'Field', 'DataType', "C(30)") * Props for the ICLOC.state field. DBSetProp('ICLOC.state', 'Field', 'KeyField', .F.) DBSetProp('ICLOC.state', 'Field', 'Updatable', .T.) DBSetProp('ICLOC.state', 'Field', 'UpdateName', 'dbo.ICLOC.STATE') DBSetProp('ICLOC.state', 'Field', 'DataType', "C(30)")hope you can help me up?
DO WHILE .T. ME.Work() ENDDO