473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join() and Array with Null

!TG
I recently learned of Join
response.write join(ThisArray, " ")

I am having trouble with it, however and it appears to be caused by null
characters.

Is there anyway around this join problem with Arrays containing Null?
Aug 2 '05 #1
7 7392
What trouble? What? Can you give us code and errors?

Ray at work

"!TG" <27********@sou thwestfunding.c om> wrote in message
news:eW******** ******@TK2MSFTN GP12.phx.gbl...
I recently learned of Join
response.write join(ThisArray, " ")

I am having trouble with it, however and it appears to be caused by null
characters.

Is there anyway around this join problem with Arrays containing Null?

Aug 2 '05 #2
!TG
Ray Costanzo [MVP] wrote:
What trouble? What? Can you give us code and errors?

Ray at work

"!TG" <27********@sou thwestfunding.c om> wrote in message
news:eW******** ******@TK2MSFTN GP12.phx.gbl...
I recently learned of Join
response.writ e join(ThisArray, " ")

I am having trouble with it, however and it appears to be caused by null
characters.

Is there anyway around this join problem with Arrays containing Null?


I am very sorry!

Error is Type mismatch: 'join'

Code example is:

Fields = Array("Name","A ddress","HomePh one",Null)
Dim FieldList
FieldList = cstr(join(Field s,","))

I also tried it without the cstr
Aug 2 '05 #3
It seems that Join cannot handle nulls as you expected. Where is the null
value coming from? Can you get rid of it when you're creating your array?
How is your array being built. In this particular sample code, you could
do:

Fields = Array("Name", "Address", "HomePhone" , Null & "")
Dim FieldList
FieldList = CStr(Join(Field s, ","))

Ray at work
"!TG" <27********@sou thwestfunding.c om> wrote in message
news:us******** ******@tk2msftn gp13.phx.gbl...
Error is Type mismatch: 'join'

Code example is:

Fields = Array("Name","A ddress","HomePh one",Null)
Dim FieldList
FieldList = cstr(join(Field s,","))

I also tried it without the cstr

Aug 2 '05 #4
!TG
Ray Costanzo [MVP] wrote:
It seems that Join cannot handle nulls as you expected. Where is the null
value coming from? Can you get rid of it when you're creating your array?
How is your array being built. In this particular sample code, you could
do:

Fields = Array("Name", "Address", "HomePhone" , Null & "")
Dim FieldList
FieldList = CStr(Join(Field s, ","))

Ray at work


The array is built fromform fields submitted to an ASP which loads
fields into arrays to update a database.

There are about 100 fields from various databases with the html forms
across 7 or 8 pages, that use that function.
I built a system for my company that keeps track of employee information
and I am trying to create a database of changes when they are made, by
whom, and to what users, so I can guard against or at least track rogue
users down, should the need arrise.
Aug 2 '05 #5
!TG wrote:
Ray Costanzo [MVP] wrote:
It seems that Join cannot handle nulls as you expected. Where is
the null value coming from? Can you get rid of it when you're
creating your array? How is your array being built. In this
particular sample code, you could do:

Fields = Array("Name", "Address", "HomePhone" , Null & "")
Dim FieldList
FieldList = CStr(Join(Field s, ","))

Ray at work


The array is built fromform fields submitted to an ASP which loads
fields into arrays to update a database.

So, when you populate the array, concatenate an empty string to the values
coming from the database.

Bob barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Aug 2 '05 #6
!TG
Bob Barrows [MVP] wrote:
!TG wrote:
Ray Costanzo [MVP] wrote:
It seems that Join cannot handle nulls as you expected. Where is
the null value coming from? Can you get rid of it when you're
creating your array? How is your array being built. In this
particular sample code, you could do:

Fields = Array("Name", "Address", "HomePhone" , Null & "")
Dim FieldList
FieldList = CStr(Join(Field s, ","))

Ray at work


The array is built fromform fields submitted to an ASP which loads
fields into arrays to update a database.


So, when you populate the array, concatenate an empty string to the values
coming from the database.

Bob barrows

There are too many different places that Null could be loaded into an array.
Can I replace Null with empty in arrays after the fact?
I've tried For Next loops before to do something similar but never had
any luck with arrays.
Aug 3 '05 #7
!TG wrote:

So, when you populate the array, concatenate an empty string to the
values coming from the database.

Bob barrows There are too many different places that Null could be loaded into an
array. Can I replace Null with empty in arrays after the fact?


Yes, but then you'll have the same problem: "too many places"
I've tried For Next loops before to do something similar but never had
any luck with arrays.


You should consider rewriting your queries that retrieve the data to be used
for these arrays to prevent the retrieval of nulls.Most versions of sql
include functions to allow you to replace nulls with empty strings or
whatever. In SQL Server's Transact-SQL you can use COALESCE or ISNULL. With
Access you can use the VBA "immediate if" function: iif()

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Aug 3 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1939
by: lawrence | last post by:
Suppose I have this table: CREATE TABLE properties ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL default '', modifierText text NOT NULL, modifierChar char(1) NOT NULL default '', modifierVarchar varchar(255) NOT NULL default '', modifierInt int(11) NOT NULL default '0',
4
4856
by: thilbert | last post by:
All, I have a perplexing problem that I hope someone can help me with. I have the following table struct: Permission ----------------- PermissionId Permission
3
10045
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def, serveur.Data_tblTABLEDECODEAUNEVALEUR TDC_AUneValeur where def.TYPEDETABLEDECODES = 4
8
4162
by: xixi | last post by:
when i create a join view like this create view JV104FZ.APJTINM1 (APAM32, APNO20, APQY05, PONO01, PONO05, PONO19, POCD01, POCD13, systimestamp, loginname, id ) as select JV104FZ.APPTINM.APAM32, JV104FZ.APPTINM.APNO20, JV104FZ.APPTINM.APQY05, JV104FZ.APPTINM.PONO01, JV104FZ.APPTINM.PONO05, JV104FZ.APPTINM.PONO19, COALESCE(JV104FZ.POPTOL.POCD01, ' '), COALESCE(JV104FZ.POPTOL.POCD13, ' '), JV104FZ.POPTOL.systimestamp,...
3
19464
by: Martin | last post by:
Hello everybody, I have the following question. As a join clause on Oracle we use " table1.field1 = table2.field1 (+) " On SQL Server we use " table1.field1 *= table2.field1 " Does DB2 have the same type of operator, without using the OUTER JOIN syntax ?
8
1570
by: alex | last post by:
Thanks in advance for any help. I'm trying to attempt the following with one table/query. I have a table called TABLE_1 It has the following fields: SSN TITLE LOCATION 322 EX DALLAS 568 REP FT_WORTH 536 EX DALLAS
3
2084
by: ssims | last post by:
I've been thinking about this problem for awhile, and can't seem to come up with a valid answer. I've got two tables, Surveys and Instructors. When a survey is completed there are one or two instructors associated with it (no surveys with zero, and no surveys with more than two). I'd like to take the data from both tables and join them to display the results. Right now I accomplish displaying all surveys with two instructors with the...
9
1733
by: chadlupkes | last post by:
I'm getting NULLs where there shouldn't be. Any help is appreciated. Here are the tables: precinct Field Type Null Key Default Extra id smallint(6) PRI NULL auto_increment precinct_number int(11) 0 precinct_name varchar(20) MUL
4
14260
by: Jane T | last post by:
I appreciate how difficult it is to resolve a problem without all the information but maybe someone has come across a similar problem. I have an 'extract' table which has 1853 rows when I ask for all rows where period_ = 3. The allocation table for info has 210 rows. I have two scripts below. The first script where I specify a period on a join, brings back 1853 lines and works. The second script where I specify the period in the...
0
7947
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8010
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.