Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2006, 06:47 PM
Registered User
 
Join Date: Jan 2006
Location: cagayan de oro, , Philippines.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to momoi
Default im new here and i need ur help....

im making a datareport in vb 6 and my database is mysql. my problem is that, in the data environment i added a command in the connection and this is my sql statement:

SELECT (tblmaster.emp_lname+', '+tblmaster.emp_fname+' '+tblmaster.emp_mi+'.') as Name, tblmaster.emp_slary, tblpos.*, tblaca.*, tblpera.*,(tblaca.aca_amount+tblpera.pe_amount) AS Total FROM tblmaster inner JOIN tblpos ON tblmaster.pos_name=tblpos.pos_no INNER JOIN tblaca ON tblmaster.emp_code=tblaca.aca_empcode INNER JOIN tblpera ON tblmaster.emp_code=tblpera.pe_empcode ORDER BY tblmaster.emp_lname ASC

when i try to view the datareport, the value returned or retrieved for Name(in bold text above) are 0's but the other fields are ok. whats wrong with the query? is that how it is done when concatinating fields in querying fields using mySQL database? but with my previous projects using access as database, there was nothing wrong. hope u could respond to this problem. i really need it.. thanks!!!! God Bless!!!

Reply With Quote
  #2 (permalink)  
Old January 19th, 2006, 06:08 PM
Registered User
 
Join Date: Jan 2006
Location: Riverside, Ca, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have found through SQL server that when trying to concatenate two fields, if one of them is Null the result is Null.

This may be the same type of issue you are running in to.

Look for a command such as NVL (Oracle) or IsNull (Sql Server) to set the Null field to a non Null value.

Reply With Quote
  #3 (permalink)  
Old January 30th, 2006, 11:44 PM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi,
When SET CONCAT_NULL_TIELDS_NULL is ON then, concatenating a NULL value with a string yields a NULL result.
Ex: -SELECT 'nalla' + NULL yields NULL.
When SET CONCAT_NULL_YIELDS_NULL is OFF then, concatenating a null value with a string yields the string itselt
Ex:- SELECT 'nalla' NULL yields nalla


nalaka hewage
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can anybody share ur knowledge wth ajax kunchala_rakesh Ajax 1 September 13th, 2007 10:10 PM
Need ur help anils Visual Basic 2005 Basics 0 May 27th, 2007 02:55 AM
Need ur help anils Visual Basic 2005 Basics 0 May 27th, 2007 02:53 AM
i want ur help! thanx! vincentaries C++ Programming 2 September 18th, 2006 03:04 PM



All times are GMT -4. The time now is 10:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.