[thelist] ASP: object read only?

Chris W. Parker cparker at swatgear.com
Fri Jul 11 17:16:29 CDT 2003

Casey Crookston <mailto:casey at thecrookstons.com> wrote:

> Anthony said:
> > Make sure the web server has rewrite access to the directory AND
> > the target DB file.
> My reply:  How would I do this?  Developing on Win XP with IIS 5.1.

Using My Computer navigate to the database file and right-click it. Choose Properties and then the Security tab. Make sure the Everyone group has Read & Execute, Read, and Write checked. The other two boxes (using win2k, you might have more boxes) should be left unchecked. Also make sure that the directory this file is in can be read and written to by Everyone. (Someone correct me if I'm wrong.)

If you don't know where the database file is you'll have to find out from your network/administrator person and have them change the permissions.

> Also, I understood everything up to your function... can you get me
> an English version of what this does?
> > Function EscapeDBData(varDataLine)
> >      if not(varDataLine = "") then
> >                  varDataLine = Replace(varDataLine,"'","''",1,-1,1)
> >          end if EscapeDBData = varDataLine
> > End Function

This function takes some input, called varDataLine, and replaces all the ' (single quotes) with '' (two single quoutes).

In english:

I would like to define a function called EscapeDBData that accepts one variable called varDataLine.

If varDataLine is not blank, perform the following actions.
  Replace all the single quote characters (') that are currently stored in varDataLine with two single quote characters ('') and put the result back into varDataLine overwriting whatever was there in the first place.

Then return the result back to the calling function/page.

I am done declaring my function.

I think the english translation might confuse you a little.

Here is a slightly simpler (more simple?) version of the same function:

Function EscapeDGData(input)
	If Not(input = "") Then
		input = Replace(input,"'","''")
	End If

	EscapeDBData = input
End Function

(Anthony please don't hate me for changing your function. ;)

hope this helps,

p.s. Anthony,

Also, any reason why you specify the start, count, and compare arguments in the Replace() function? I've never used them before so maybe there is some wisdom in there that I should follow.

More information about the thelist mailing list