Hey folks,
This one's probably been asked before but I'm tired of trying to find a
solution (if there is one!). I have an asp update page and I'd like to
convert all empty fields to NULL prior to updating the Access db rather than
permitting zero length fields in the db. Is this possible? Is there any way
to globally declare this for all text fields on the asp page rather than
having to do a whole whack of "if then" formats? Is there something I can
set in the field's properties in Access that will deny zero length yet won't
cause the asp update to choke and return an error?
Thanks for any feedback,
Dave
--
______________________________
Remove "_SPAM" to reply directly. 6 1489
David Shorthouse wrote: Hey folks,
This one's probably been asked before but I'm tired of trying to find a solution (if there is one!). I have an asp update page and I'd like to convert all empty fields to NULL prior to updating the Access db rather than permitting zero length fields in the db. Is this possible?
Sure, just pass Null when the user does not enter data.
Is there any way to globally declare this for all text fields on the asp page rather than having to do a whole whack of "if then" formats?
No
Is there something I can set in the field's properties in Access that will deny zero length yet won't cause the asp update to choke and return an error?
No.
--
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"
Bob,
Thanks for the quick response. How then does one pass null when the
field is empty? I'm sad to hear there isn't any way to declare this for all
variables in one shot, say at the very beginning of the script on the the
asp. Could you provide a vbscipt I ought to include on the asp?
Thanks.
Dave
--
______________________________
Remove "_SPAM" to reply directly.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... David Shorthouse wrote: Hey folks,
This one's probably been asked before but I'm tired of trying to find a solution (if there is one!). I have an asp update page and I'd like to convert all empty fields to NULL prior to updating the Access db rather than permitting zero length fields in the db. Is this possible?
Sure, just pass Null when the user does not enter data.
Is there any way to globally declare this for all text fields on the asp page rather than having to do a whole whack of "if then" formats?
No
Is there something I can set in the field's properties in Access that will deny zero length yet won't cause the asp update to choke and return an error?
No.
-- 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"
David Shorthouse wrote: Bob,
Thanks for the quick response. How then does one pass null when the field is empty? I'm sad to hear there isn't any way to declare this for all variables in one shot, say at the very beginning of the script on the the asp. Could you provide a vbscipt I ought to include on the asp?
It depends. Are you using a recordset (not recommended)? Dynamic SQL (also
not recommended)? Parameters?
--
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"
Bob,
I am indeed using a recordset with UPDATE and SET. Why is this not
recommended? What's the better alternative?
Dave
--
______________________________
Remove "_SPAM" to reply directly.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl... David Shorthouse wrote: Bob,
Thanks for the quick response. How then does one pass null when the field is empty? I'm sad to hear there isn't any way to declare this for all variables in one shot, say at the very beginning of the script on the the asp. Could you provide a vbscipt I ought to include on the asp?
It depends. Are you using a recordset (not recommended)? Dynamic SQL (also not recommended)? Parameters? -- 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"
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OZ**************@TK2MSFTNGP15.phx.gbl...
: David Shorthouse wrote:
: > Bob,
: >
: > I am indeed using a recordset with UPDATE and SET. Why is this not
: > recommended? What's the better alternative?
<snip>
: Using "UPDATE and SET" seems to imply that you are using dynamic sql. This
: is not recommended due to the security concerns brought on by leaving
: yourself open to sql injection attacks by hackers:
I'd be happy to test those for ya', David. (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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris |
last post by:
I have tableA, defined as:
field1 varchar2(10),
field2 varchar2(10),
field3 varchar2(10)
I have host variables defined as:
v1 pic x(10) varying
v2 pic x(10) varying
|
by: FizzBin |
last post by:
We are writing a C application that is using ODBC to insert records
into a database. We have a NOT NULL column that can legitimately have
an empty value, i.e. we know the value and it is empty...
|
by: Bernd Lambertz |
last post by:
I have a problem with bcp and format files.
We changed our databases from varchar to nvarchar to support unicode. No
problems so fare with that. It is working fine.
But now I need a format...
|
by: ezelasky |
last post by:
We are using the bcp utility (via APIs) to export data from a SQL table
in a fixed format text file. BCP is inserting spaces for a field if
the field contains a NULL. This is fine with us except...
|
by: Lyn |
last post by:
I am trying to get my head around the concept of default, special or empty
values that appear in Access VBA, depending on data type. The Access Help
is not much (help), and the manual that I have...
| |
by: ramonred |
last post by:
Hi All,
this is the error:
Input string was not in a correct format.
this is the code I am trying to debug:
<code>
string sql = @"
INSERT INTO
(UserID, Login, Password, FirstName, LastName,...
|
by: surya |
last post by:
hello all
i want to create a phone table and it contains two fields empid ,ph.
the phone table following format:
Phone table
------------------------------------------
empid ph...
|
by: Mike |
last post by:
Greetings,
It would seem that this topic has been discussed at some length, but I
was unable to discern whether there was a clear cut solution to resolve
and/or otherwise workaround the issue.
...
|
by: robertino |
last post by:
Hi all,
I've put together a few SPs to produce a BOM (bill of materials)
listing, which together use a couple of global temp tables, and return
the results from a cursor. Here's the code:
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |