How to handle "#" in Recordset?

How to handle "#" in Recordset?

Post by stell » Thu, 07 Feb 2002 02:48:49



I have a piece of code look like this
.....

 rstWellMaster.AddNew
           rstWellMaster!welluserid = rstWellInt!welluserid
            rstWellMaster!WellName = rstWellInt!WellName
.....

which the WellName and WellUserID are fields in the table.
The code works fine until it comes to some fields that contain character " #
",  Which I think is the cause of my failure.

So , Can any one there tell me how to deal with problem ?
I don't want to change the table field btw.

THANKS

Stella

 
 
 

How to handle "#" in Recordset?

Post by Michael Visinti » Thu, 07 Feb 2002 06:31:25


Stella,

I have only had problems with special characters like the apostrophe and the
# when I was using the data in the field to construct an SQL statement.  I
have never had a problem with special characters when just using a simple
assignment statement.

What is the error you are getting?

Michael


Quote:> I have a piece of code look like this
> .....

>  rstWellMaster.AddNew
>            rstWellMaster!welluserid = rstWellInt!welluserid
>             rstWellMaster!WellName = rstWellInt!WellName
> .....

> which the WellName and WellUserID are fields in the table.
> The code works fine until it comes to some fields that contain character "
#
> ",  Which I think is the cause of my failure.

> So , Can any one there tell me how to deal with problem ?
> I don't want to change the table field btw.

> THANKS

> Stella


 
 
 

How to handle "#" in Recordset?

Post by VOrte » Thu, 07 Feb 2002 10:16:55


Put the field in []

[Serial#]

Regards

VOrtex


Quote:> I have a piece of code look like this
> .....

>  rstWellMaster.AddNew
>            rstWellMaster!welluserid = rstWellInt!welluserid
>             rstWellMaster!WellName = rstWellInt!WellName
> .....

> which the WellName and WellUserID are fields in the table.
> The code works fine until it comes to some fields that contain character "
#
> ",  Which I think is the cause of my failure.

> So , Can any one there tell me how to deal with problem ?
> I don't want to change the table field btw.

> THANKS

> Stella