Discussion:
Connecting to MSSQL on Intranet / Internet.
(too old to reply)
Ujjal
2007-09-16 19:27:57 UTC
Permalink
Hi I,m new to MSSQL backend + intranet/internet programming.
I want to update data (barcode labels) from multiple locations to a central
server located on Intranet. I am willing to use remote views or direct
select sql statements.
Will it be like creating a new ODBC connection from control panel of each
machine giving it some specific name like AssetConn and use that name from
all the programs?
I will be writing to 2 to 3 tables whose remote view Cursorsetprop Buffering
shall be set to 5. Should I use Tableupdate(2,.T.) once or
Tableupdate("viewName",.T.) for each table.
If I give Begin transaction before Tableupadate() and end transaction after
that will it make my updations more successful ?
Any tips or links shall be greatly appreciated.
Thanking you in advance
Ujjal
Stefan Wuebbe
2007-09-16 09:55:23 UTC
Permalink
Post by Ujjal
Hi I,m new to MSSQL backend + intranet/internet programming.
I want to update data (barcode labels) from multiple locations to a
central server located on Intranet. I am willing to use remote views or
direct select sql statements.
Will it be like creating a new ODBC connection from control panel of each
machine giving it some specific name like AssetConn and use that name from
all the programs?
Yes, you can do it that way.
(Alternatively, have a look at "DSN-less connections", e.g. SQLConnect()
in help or google.)
Post by Ujjal
I will be writing to 2 to 3 tables whose remote view Cursorsetprop
Buffering shall be set to 5. Should I use Tableupdate(2,.T.) once or
Tableupdate("viewName",.T.) for each table.
If I give Begin transaction before Tableupadate() and end transaction
after that will it make my updations more successful ?
Depends -
TableUpdate() attempts can always fail (for example, other users
may have modified the same row meanwhile or Triggers say "No"
etc.).
So you'd always check the returned value of any TableUpdate()
attempt in your code and TableRevert() when it did not succeed.
See also AError() in help.

Transactions usually come into play when one TableUpdate()
depends on another one, e.g. in pseudo-code:
Begin Transaction
If TableUpdate(...,"alias1") And TableUpdate(...,"alias2")
End Transaction
Else
Rollback
TableRevert(...
Messagebox(...
Post by Ujjal
Any tips or links shall be greatly appreciated.
The big difference between "local" VFP databases and "RDBMS"
backends connected via ODBC is that you don't display entire
tables usually. That is, when you can display all "customers" initially
in your list form in the former case, in the latter you'd always display
an empty grid first and wait for the user to type some filter conditions
and the Requery("yourView"). See also "parameterized views" in
help or google groups search.

There are books on RDBMS available at Hentzenwerke.com:
http://www.hentzenwerke.com/catalog/csvfp.htm
http://www.hentzenwerke.com/catalog/mysqlvfp.htm


hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Ujjal
2007-09-16 23:26:14 UTC
Permalink
Thank a lot. Wll chek it out.

Ujjal
Post by Stefan Wuebbe
Post by Ujjal
Hi I,m new to MSSQL backend + intranet/internet programming.
I want to update data (barcode labels) from multiple locations to a
central server located on Intranet. I am willing to use remote views or
direct select sql statements.
Will it be like creating a new ODBC connection from control panel of each
machine giving it some specific name like AssetConn and use that name
from all the programs?
Yes, you can do it that way.
(Alternatively, have a look at "DSN-less connections", e.g. SQLConnect()
in help or google.)
Post by Ujjal
I will be writing to 2 to 3 tables whose remote view Cursorsetprop
Buffering shall be set to 5. Should I use Tableupdate(2,.T.) once or
Tableupdate("viewName",.T.) for each table.
If I give Begin transaction before Tableupadate() and end transaction
after that will it make my updations more successful ?
Depends -
TableUpdate() attempts can always fail (for example, other users
may have modified the same row meanwhile or Triggers say "No"
etc.).
So you'd always check the returned value of any TableUpdate()
attempt in your code and TableRevert() when it did not succeed.
See also AError() in help.
Transactions usually come into play when one TableUpdate()
Begin Transaction
If TableUpdate(...,"alias1") And TableUpdate(...,"alias2")
End Transaction
Else
Rollback
TableRevert(...
Messagebox(...
Post by Ujjal
Any tips or links shall be greatly appreciated.
The big difference between "local" VFP databases and "RDBMS"
backends connected via ODBC is that you don't display entire
tables usually. That is, when you can display all "customers" initially
in your list form in the former case, in the latter you'd always display
an empty grid first and wait for the user to type some filter conditions
and the Requery("yourView"). See also "parameterized views" in
help or google groups search.
http://www.hentzenwerke.com/catalog/csvfp.htm
http://www.hentzenwerke.com/catalog/mysqlvfp.htm
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Loading...