Hi, I have some questions about replace with mdb file with xml file:
Can I use ado and xml to store info instead of Ms access database, what
will be the diff?
can ado and xml support mult-user
Concurrent access? Thansk...

Re: ado and xml? by Bob

Bob
Fri Apr 01 15:30:41 CST 2005

js wrote:
> Hi, I have some questions about replace with mdb file with xml file:

Don't

> Can I use ado

ado is not needed to use xml

> and xml to store info instead of Ms access database,

Yes, but ....

> what will be the diff?

No referential integrity. No SQL language. No data constraints. xml is
simply a text file.

> can ado and xml support mult-user
> Concurrent access? Thansk...

No. You will wind up having to reinvent the wheel with your own code. it's
not worth it.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by js

js
Fri Apr 01 15:43:12 CST 2005

Thanks Bob,
"Bob Barrows [MVP]" wrote in message
>
>> can ado and xml support mult-user
>> Concurrent access? Thansk...
>
> No. You will wind up having to reinvent the wheel with your own code. it's
> not worth it.
>
I only have three fields(Email, Password, IP), I think it will simply to use
text file instead of a database. ado can use discount recordset to bind to a
extenal file, but I'm worry about the concurrent access problem? what happen
when more than 10 user access at the same time? Please help...



Re: ado and xml? by Curt_C

Curt_C
Fri Apr 01 15:58:24 CST 2005

If you are going to have 10+ users accessing this at the same exact moment
you will not wany ANY file based storage, this includes MDB. You are going
to have to look at an SQL type option.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"js" <js@someone@hotmail.com> wrote in message
news:ecIdPPwNFHA.4052@TK2MSFTNGP12.phx.gbl...
> Thanks Bob,
> "Bob Barrows [MVP]" wrote in message
>>
>>> can ado and xml support mult-user
>>> Concurrent access? Thansk...
>>
>> No. You will wind up having to reinvent the wheel with your own code.
>> it's not worth it.
>>
> I only have three fields(Email, Password, IP), I think it will simply to
> use text file instead of a database. ado can use discount recordset to
> bind to a extenal file, but I'm worry about the concurrent access problem?
> what happen when more than 10 user access at the same time? Please help...
>
>



Re: ado and xml? by js

js
Fri Apr 01 16:02:10 CST 2005

Thanks for the help,
Is it a sample teach how to save info to a file use ado?

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eYPkcWwNFHA.2880@TK2MSFTNGP10.phx.gbl...
> If you are going to have 10+ users accessing this at the same exact moment
> you will not wany ANY file based storage, this includes MDB. You are going
> to have to look at an SQL type option.
>



Re: ado and xml? by js

js
Fri Apr 01 17:50:33 CST 2005

Cool...

"dlbjr" <dlbjr@donotknow.com> wrote in message
news:uwyfMTxNFHA.244@tk2msftngp13.phx.gbl...
> Use the attached XML file and the following code.
> Do what ever you want with it.
>
> Set rs = CreateObject("ADODB.Recordset")
> rs.Open "data.xml"
>
> 'Do What Ever
>
> rs.Save "data.xml",1
> Set rs = Nothing
>
>
>
> --
> dlbjr
> Pleading sagacious indoctrination!
>
>



Re: ado and xml? by js

js
Fri Apr 01 17:54:01 CST 2005

is it this method only limit to 10+ users accessing this at the same exact
time? or not limit?


"dlbjr" <dlbjr@donotknow.com> wrote in message
news:uwyfMTxNFHA.244@tk2msftngp13.phx.gbl...
> Use the attached XML file and the following code.
> Do what ever you want with it.
>
> Set rs = CreateObject("ADODB.Recordset")
> rs.Open "data.xml"
>
> 'Do What Ever
>
> rs.Save "data.xml",1
> Set rs = Nothing
>
>
>
> --
> dlbjr
> Pleading sagacious indoctrination!
>
>



Re: ado and xml? by dlbjr

dlbjr
Fri Apr 01 18:03:04 CST 2005

Limit is not a problem.

For safety reasons just wrap any code reading, writing the data in
Application.Lock and Application.Unlock This will guarantee one operation at
a time.

--
dlbjr
Pleading sagacious indoctrination!



Re: ado and xml? by Bob

Bob
Fri Apr 01 20:12:04 CST 2005

dlbjr wrote:
> Limit is not a problem.
>
> For safety reasons just wrap any code reading, writing the data in
> Application.Lock and Application.Unlock This will guarantee one
> operation at a time.

You forgot that he had to spcify keeping the xml file in Application,
something that is not recommended for ado objects ....

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by js

js
Fri Apr 01 20:28:58 CST 2005


"Bob Barrows [MVP]" wrote in message news:u8f%
>> Limit is not a problem.
>>
>> For safety reasons just wrap any code reading, writing the data in
>> Application.Lock and Application.Unlock This will guarantee one
>> operation at a time.
>
> You forgot that he had to spcify keeping the xml file in Application,
> something that is not recommended for ado objects ....
>
Can you explain why the xml file is not recommended for ado objects? Thanks.



Re: ado and xml? by js

js
Fri Apr 01 20:32:55 CST 2005


"dlbjr" wrote in message
> Limit is not a problem.
>
> For safety reasons just wrap any code reading, writing the data in
> Application.Lock and Application.Unlock This will guarantee one operation
> at a time.
>
What happen when someone is access the file and lock, and another is trying
to access it? Will line up? Thanks for the help...



Re: ado and xml? by Bob

Bob
Fri Apr 01 20:44:36 CST 2005

js wrote:
> "Bob Barrows [MVP]" wrote in message news:u8f%
>>> Limit is not a problem.
>>>
>>> For safety reasons just wrap any code reading, writing the data in
>>> Application.Lock and Application.Unlock This will guarantee one
>>> operation at a time.
>>
>> You forgot that he had to spcify keeping the xml file in Application,
>> something that is not recommended for ado objects ....
>>
> Can you explain why the xml file is not recommended for ado objects?
> Thanks.

Not the xml object. As long as you use the slow free-threaded version of the
xml document, you'll be all right. it';s the ADO object I'm talking about.
ADO by default is not free-threaded, and therefore should not be kept int
session or application.

http://www.aspfaq.com/show.asp?id=2053

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by Bob

Bob
Fri Apr 01 20:46:16 CST 2005

js wrote:
> "dlbjr" wrote in message
>> Limit is not a problem.
>>
>> For safety reasons just wrap any code reading, writing the data in
>> Application.Lock and Application.Unlock This will guarantee one
>> operation at a time.
>>
> What happen when someone is access the file and lock, and another is
> trying to access it? Will line up? Thanks for the help...

You will force all accesses of the object to be serialized, which will limit
scalability, You really should forget this idea, especially if your data is
related to other data. A database is designed for this.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by js

js
Fri Apr 01 20:59:42 CST 2005

Thanks Bob.



Re: ado and xml? by dlbjr

dlbjr
Fri Apr 01 22:36:20 CST 2005

The solution will work for your need.
For the picky ones, you could use a true dataset offered in asp.net.
Make calls to an aspx file to add,edit or delete data then serialize the dataset.
Everything else stays asp.

'dlbjr
'Pleading sagacious indoctrination!



Re: ado and xml? by Roland

Roland
Sat Apr 02 02:30:25 CST 2005

"Bob Barrows [MVP]" wrote in message
news:OFX5OIwNFHA.576@TK2MSFTNGP15.phx.gbl...
: js wrote:
: > Hi, I have some questions about replace with mdb file with xml file:
:
: Don't
:
: > Can I use ado
:
: ado is not needed to use xml
:
: > and xml to store info instead of Ms access database,
:
: Yes, but ....
:
: > what will be the diff?
:
: No referential integrity. No SQL language. No data constraints. xml is
: simply a text file.
:
: > can ado and xml support mult-user
: > Concurrent access? Thansk...
:
: No. You will wind up having to reinvent the wheel with your own code. it's
: not worth it.

Not sure what you're saying here Bob. Are you saying using an XML file on
the net with multiple users is a bad idea?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: ado and xml? by Bob

Bob
Sat Apr 02 06:12:45 CST 2005

Roland Hall wrote:
> "Bob Barrows [MVP]" wrote in message
> news:OFX5OIwNFHA.576@TK2MSFTNGP15.phx.gbl...
>> js wrote:
>>> Hi, I have some questions about replace with mdb file with xml file:
>>
>> Don't
>>
>>> Can I use ado
>>
>> ado is not needed to use xml
>>
>>> and xml to store info instead of Ms access database,
>>
>> Yes, but ....
>>
>>> what will be the diff?
>>
>> No referential integrity. No SQL language. No data constraints. xml
>> is simply a text file.
>>
>>> can ado and xml support mult-user
>>> Concurrent access? Thansk...
>>
>> No. You will wind up having to reinvent the wheel with your own
>> code. it's not worth it.
>
> Not sure what you're saying here Bob. Are you saying using an XML
> file on the net with multiple users is a bad idea?

I'm not sure if this is a facetious question or not, but I'll answer it as
if it is a straight question, given that I may have over-made my point. :-)

So, "Are you saying using an XML file on the net with multiple users is a
bad idea?"

A. Not necessarily.

I'm saying that replacing a database, which provides the builtin
functionality to support multiple users and protect the integrity of the
data it contains, with a text file, xml or csv, may not be a good idea. It
forces the developer to reinvent the wheel, writing all the code to provide
the same functionality that was provided by the database. Consider the years
it has taken the developers of Jet to get to the point they are at now, as
well as all the mistakes that were made and corrected along the way.
Providing that functionality is not an easy task. Not impossible, but
definitely daunting.

However:
Using a read-only (or update-rarely) text file (or xml document stored in
application or session) to cache frequently used, relatively static data is
a very good idea. In a perfect world, the data would still come from a
database, but with truly static data, that is not necessary.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by js

js
Sat Apr 02 09:06:10 CST 2005

Hello, can I use csv file instead of data.xml file?

"dlbjr" <dlbjr@donotknow.com> wrote in message
news:uwyfMTxNFHA.244@tk2msftngp13.phx.gbl...
> Use the attached XML file and the following code.
> Do what ever you want with it.
>
> Set rs = CreateObject("ADODB.Recordset")
> rs.Open "data.xml"
>
> 'Do What Ever
>
> rs.Save "data.xml",1
> Set rs = Nothing
>
>



Re: ado and xml? by dlbjr

dlbjr
Sat Apr 02 10:38:09 CST 2005

js,

Once the data is loaded into the recordset you can filter, sort, add, edit, delete the data just as
in SQL.
Where are you storing data in a session or application Variable?
If needed the xml can be Serialized into a string for storing in an application variable.

Take a look at the following code. This is used to store XML in a session or application Variable
and load and unload into a recordset when needed. This can be on an include asp file if needed.

I would store the xml file on the harddrive myself.

<SCRIPT language="vbscript" runat="server">
Class RSXML
Private mrecordset
Private mxmldom

Private Sub Class_Initialize()
Set mxmldom = CreateObject("MSXML2.DOMDocument")
Set mrecordset = CreateObject("ADODB.Recordset")
End Sub

Private Sub Class_Terminate()
Set mxmldom = Nothing
Set mrecordset = Nothing
End Sub

Public Function Serialize(recordset)
On Error Resume Next
recordset.Save mxmldom, 1
Serialize = mxmldom.xml
End Function

Public Function Deserialize(strXML)
On Error Resume Next
mxmldom.loadXML strXML
mrecordset.Open mxmldom
Set Deserialize = mrecordset
End Function
End Class
</SCRIPT>


'dlbjr
'Pleading sagacious indoctrination!



Re: ado and xml? by Bob

Bob
Sat Apr 02 10:54:16 CST 2005

Roland Hall wrote:
>
> So, if a read-only XML file is shared and RW XML files are separate
> for each user, that's not an issue?

Correct. I see nothing wrong with that. In fact, I use similar strategy in a
few of my apps.

Bob

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by Roland

Roland
Sat Apr 02 10:22:56 CST 2005

"Bob Barrows [MVP]" wrote in message
news:OlaLF13NFHA.940@TK2MSFTNGP09.phx.gbl...
: Roland Hall wrote:
: > "Bob Barrows [MVP]" wrote in message
: > news:OFX5OIwNFHA.576@TK2MSFTNGP15.phx.gbl...
: >> js wrote:
: >>> Hi, I have some questions about replace with mdb file with xml file:
: >>
: >> Don't
: >>
: >>> Can I use ado
: >>
: >> ado is not needed to use xml
: >>
: >>> and xml to store info instead of Ms access database,
: >>
: >> Yes, but ....
: >>
: >>> what will be the diff?
: >>
: >> No referential integrity. No SQL language. No data constraints. xml
: >> is simply a text file.
: >>
: >>> can ado and xml support mult-user
: >>> Concurrent access? Thansk...
: >>
: >> No. You will wind up having to reinvent the wheel with your own
: >> code. it's not worth it.
: >
: > Not sure what you're saying here Bob. Are you saying using an XML
: > file on the net with multiple users is a bad idea?
:
: I'm not sure if this is a facetious question or not, but I'll answer it as
: if it is a straight question, given that I may have over-made my point.
:-)

I know I kid around a lot but it was a straight question.

: So, "Are you saying using an XML file on the net with multiple users is a
: bad idea?"
:
: A. Not necessarily.
:
: I'm saying that replacing a database, which provides the builtin
: functionality to support multiple users and protect the integrity of the
: data it contains, with a text file, xml or csv, may not be a good idea. It
: forces the developer to reinvent the wheel, writing all the code to
provide
: the same functionality that was provided by the database. Consider the
years
: it has taken the developers of Jet to get to the point they are at now, as
: well as all the mistakes that were made and corrected along the way.
: Providing that functionality is not an easy task. Not impossible, but
: definitely daunting.
:
: However:
: Using a read-only (or update-rarely) text file (or xml document stored in
: application or session) to cache frequently used, relatively static data
is
: a very good idea. In a perfect world, the data would still come from a
: database, but with truly static data, that is not necessary.

So, if a read-only XML file is shared and RW XML files are separate for each
user, that's not an issue? I'm asking because I'm doing that in lieu of
using an Access database and getting good results. I will however be
offering multiple database versions but for now, just XML.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp




Re: ado and xml? by js

js
Sat Apr 02 13:02:13 CST 2005


"dlbjr" wrote in message > js,
>
> Once the data is loaded into the recordset you can filter, sort, add,
> edit, delete the data just as
> in SQL.
> Where are you storing data in a session or application Variable?
> If needed the xml can be Serialized into a string for storing in an
> application variable.
>
Set rs = CreateObject("ADODB.Recordset")
rs.Open "data.xml"

can I open a csv file instead of the defined data.xml file?

>>data.txt
dlbjr@ss.com, 1, 127.0.0.1
js@ss.com, 2, 127.0.0.1



Re: ado and xml? by Bob

Bob
Sat Apr 02 14:39:44 CST 2005

js wrote:
> "dlbjr" wrote in message > js,
>>
>> Once the data is loaded into the recordset you can filter, sort, add,
>> edit, delete the data just as
>> in SQL.
>> Where are you storing data in a session or application Variable?
>> If needed the xml can be Serialized into a string for storing in an
>> application variable.
>>
> Set rs = CreateObject("ADODB.Recordset")
> rs.Open "data.xml"
>
> can I open a csv file instead of the defined data.xml file?
>
>>> data.txt
> dlbjr@ss.com, 1, 127.0.0.1
> js@ss.com, 2, 127.0.0.1

Yes Either using FileSystemObject (fso) or ADO. Here's the ADO way:
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMicrosoftJetText

See the vbscript documentation for help on using fso.
http://tinyurl.com/7rk6

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: ado and xml? by js

js
Sat Apr 02 20:00:57 CST 2005

Thanks for the help Bob.



Re: ado and xml? by Roland

Roland
Sun Apr 03 04:33:57 CDT 2005

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:%23LkvYS6NFHA.576@TK2MSFTNGP15.phx.gbl...
: Roland Hall wrote:
: >
: > So, if a read-only XML file is shared and RW XML files are separate
: > for each user, that's not an issue?
:
: Correct. I see nothing wrong with that. In fact, I use similar strategy in
a
: few of my apps.

Thanks Bob. (O:=

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp




Re: ado and xml? by js

js
Tue Apr 05 08:43:02 CDT 2005

Hi dlbjr,
I can't save to data entry into the xml file:
Error: Can't save.

what permisstion do I need to set to file?

"dlbjr" <dlbjr@donotknow.com> wrote in message
news:uwyfMTxNFHA.244@tk2msftngp13.phx.gbl...
> Use the attached XML file and the following code.
> Do what ever you want with it.
>
> Set rs = CreateObject("ADODB.Recordset")
> rs.Open "data.xml"
>
> 'Do What Ever
>
> rs.Save "data.xml",1
> Set rs = Nothing
>
>
>
> --
> dlbjr
> Pleading sagacious indoctrination!
>
>



Re: ado and xml? by dlbjr

dlbjr
Tue Apr 05 20:32:18 CDT 2005

Does the xml file exits and you are rewriting or are you writing the file for the first time?
Where is the file located. Make sure permissions are set on file if outside of web app folder.
Why can you not use a small access database for this? You seem to want a text file solution.
Is there some constraint to cause this decision?

--
'dlbjr
'Pleading sagacious indoctrination!



Re: ado and xml? by js

js
Thu Apr 07 08:40:08 CDT 2005

hi dldjr,
I found it out, http://support.microsoft.com/kb/818518


"dlbjr" <oops@iforgot.com> wrote in message
news:eItM5hkOFHA.1268@TK2MSFTNGP14.phx.gbl...
> Does the xml file exits and you are rewriting or are you writing the file
> for the first time?
> Where is the file located. Make sure permissions are set on file if
> outside of web app folder.
> Why can you not use a small access database for this? You seem to want a
> text file solution.
> Is there some constraint to cause this decision?
>
> --
> 'dlbjr
> 'Pleading sagacious indoctrination!
>
>



Re: ado and xml? by dlbjr

dlbjr
Thu Apr 07 16:43:05 CDT 2005

Kewl!

--
'dlbjr
'Pleading sagacious indoctrination!



Re: ado and xml? by German

German
Fri Apr 08 23:45:29 CDT 2005

It is correct that you should "go further, bigger and more robust" data save
solution when building web apps. But at the same time i have built web apps
with access db for more 50 users and there hasn't even go or slow down at
all after 6 months. Remeber these 50+ users are not "really accessing the
db at the same time. The recordsets are disconnected.. They're accessed
and the db is released. Of course on these cases, the applications are not
critical neither 24/7 and it won't cause any big damage if it goes down for
a while.

It all depends on your needs or company needs and the growth of the
application. In my case this was used to save costs by the company and it
is known that the growth of these activities are not closer than 10 years.
So, my customers are happy with the solution. for some others and
differents cases I have had to go with oracle or SQL Server.

--
________________
German Saer
gsaer@hotmail.com
Orlando, FL

"Roland Hall" <nobody@nowhere> wrote in message
news:Oq3%23DBDOFHA.3156@TK2MSFTNGP15.phx.gbl...
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:%23LkvYS6NFHA.576@TK2MSFTNGP15.phx.gbl...
> : Roland Hall wrote:
> : >
> : > So, if a read-only XML file is shared and RW XML files are separate
> : > for each user, that's not an issue?
> :
> : Correct. I see nothing wrong with that. In fact, I use similar strategy
in
> a
> : few of my apps.
>
> Thanks Bob. (O:=
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>
>



Re: ado and xml? by Roland

Roland
Sat Apr 09 00:54:53 CDT 2005

"German Saer" wrote in message
news:J5J5e.26056$vd.12823@tornado.tampabay.rr.com...
: It is correct that you should "go further, bigger and more robust" data
save
: solution when building web apps. But at the same time i have built web
apps
: with access db for more 50 users and there hasn't even go or slow down at
: all after 6 months. Remeber these 50+ users are not "really accessing the
: db at the same time. The recordsets are disconnected.. They're accessed
: and the db is released. Of course on these cases, the applications are
not
: critical neither 24/7 and it won't cause any big damage if it goes down
for
: a while.
:
: It all depends on your needs or company needs and the growth of the
: application. In my case this was used to save costs by the company and it
: is known that the growth of these activities are not closer than 10 years.
: So, my customers are happy with the solution. for some others and
: differents cases I have had to go with oracle or SQL Server.

Thanks Saer..

In this case, it's a shopping cart. I'd prefer it go down only during
scheduled maintenance. I am currently writing db versions of the cart, and
an XML module for distributors since it is currently MS SQL. I am going to
submit the XML version for testing and wanted to know if what I had written
was going to have issues. It may have other issues for other reasons but I
didn't want data corruption to be one of them.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */