Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Visual Foxpro for a database on a web site?????
Message
From
03/01/2001 14:59:04
 
 
To
29/12/2000 11:18:28
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Internet
Category:
Active Server Page
Miscellaneous
Thread ID:
00457797
Message ID:
00459065
Views:
27
>Thanks for the examples, that really helps... can you answer a couple >questions about it?
You're welcome for the examples they help me greatly as well usually:). Sure here are the answers to your questions (I Hope!).

>Ok, maybe you can answer a question that no one seems to be able to answer... >this GLOBAL.ASA file, is
>this like and INCLUDE file that needs to be referenced and uploaded to the >webserver as well or is this a local
>file needed when my HTML development app (Netobject Fusion and soon
>DreamWeaver UltraDev)?

No it is NOT an include file as such and YES it MUST be uploaded tou your server. By that I mean that, simply put, If it were then EVERY asp page you had would include this file. As well as Response.Buffer = True which would load the global.asa file and process the page before HTML output. An NT server the server reads this file similar to an ini file in a standard windows application. It is just a configuration file for your site. NOTE: It MUST be in the root direcory, if you did need more tan one global.asa files due to multiple "apps" (sites) there are ways aroung this. Hwever the globale.asa files sil has to remain in you root you onlt need to make references other "apps" od Sites! i.e. http://www.mysite.com/global.asa NOT http://www.mysite.com/anothersitehere/global.asa.

>> Set rsCustomers = Server.CreateObject("ADODB.Recordset")
>> CustSQL = "SELECT * FROM customers where 1 <> 1"

>What is this select statement for? Does this preload the record set with ALL >the records in the table?

Yep, but not records just the fields.


>> 'BeginTrans speeds up accesing data 17 times
>> dbMain.BeginTrans
>> rsCustomers.ActiveConnection = dbMain
>> rsCustomers.CursorType = 1
>> rsCustomers.LockType = 3
>> rsCustomers.Open CustSQL
>> rsCustomers.AddNew
>> rsCustomers( "customerid" ) = CustID
>> rsCustomers ( "fname" ) = qfname
>> rsCustomers ( "lname" ) = qlname
>> rsCustomers ( "address" ) = qaddress
>> rsCustomers ( "city" ) = qcity
>> rsCustomers ( "state" ) = qstate
>> rsCustomers ( "zip" ) = qzip
>> rsCustomers ( "country" ) = qcountry
>> rsCustomers ( "phone" ) = qphone
>> rsCustomers ( "email" ) = qemail
>> rsCustomers ( "machinemake" ) = qmake
>> rsCustomers ( "machinemodel" ) = qmodel
>> rsCustomers ( "freedollars" ) = 0
>> dbMain.CommitTrans

>Hmmm, what is this for... maybe that is what I am missing in my stuff

What is what for?...
rsCustomers ( "machinemodel" ) = qmodel (This?) if so then...
rsCustomers is the recdordset you are working with
( "machinemodel" ) id the field name
and qmodel id the value to add to that field in that record set at that location.

If you are referring to dbMain.BeginTrans and dbMain.comitTrans then this caches the recordset on the server side and speeds up the process 17 time according to Microsoft who as you know has NEVER been wrong *GRIN*.

>> Set rsindex = Server.CreateObject("ADODB.Recordset")
>> indexSQL = "SELECT customers FROM Set rsindex = Server.CreateObject
>>("ADODB.Recordset")
>> indexSQL = "SELECT customers FROM indexes"

>Two SQLs????

No sorry for the confusion just a typo.
Here is what I meant to say..
Set rsindex = Server.CreateObject("ADODB.Recordset")
indexSQL = "SELECT customers FROM indexs"

this and the code below is merely a safe way to ensure you will always have a unique CustID (Customer ID number). It works better this way because it never matters if the server is reboted (such as using session or global variabkes) and frankly I have never had much faith in random character generation routines, sure it's a billio to one chance you'll get the same number but better safe than sorry :). Add as many fields to this index table as you like if you need a unique ID number 1 field = 1 table index.

>> rsindex.ActiveConnection = dbMain
>> rsindex.CursorType = 1
>> rsindex.LockType = 3
>> rsindex.Open indexSql
>> CustID = trim(rsindex("customers"))
>> CustID = CustID + 1
>> 'Assign a new value to the customer index field
>> rsindex( "customers" ) = CustID
>> rsindex.Update
>> rsIndex.Close"
>> rsindex.ActiveConnection = dbMain
>> rsindex.CursorType = 1
>> rsindex.LockType = 3
>> rsindex.Open indexSql
>> CustID = trim(rsindex("customers"))
>> CustID = CustID + 1
>> 'Write a new index value to the customer field
>> rsindex( "customers" ) = CustID
>> rsindex.Update
>> rsIndex.Close




>Thanks Mike, any help is greatly appreciated... until this message and one >other, I was giving serious
>consideration to blowing out the VFP stuff in this site and converting to >Access. I prefer to do my regular
>DB apps with VFP and hate the thought of using Access - sort of a downgrade.

True I have even heard somwhere that in some cases access tables can only support 100 concurent users, but I think that was more of local Windows application statement not refering to ADO but not sure really.


Hope this answers you're questions if not feel free to email me I will help in any way I can.
zorfox@acceleration.net
Good luck your on the home stretch *GRIN*
-----------------------------------------------------
| I love deadlines. I love the way the whoosh by! |
-----------------------------------------------------
Previous
Reply
Map
View

Click here to load this message in the networking platform