Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Difference between version

 
   Database Forums (Home) -> MSDE RSS
Next:  The Dominican Republic from the UK  
Author Message
vovan

External


Since: Jul 16, 2007
Posts: 15



(Msg. 1) Posted: Sat Feb 16, 2008 11:59 am
Post subject: Difference between version
Archived from groups: microsoft>public>sqlserver>msde, others (more info?)

I have SELECT statement in VB6 application. It is used to populate
ADODB.Recordset.
It works fine when I connect to SQL 2000 and SQL 2005 databases. It works
fine as well if I run it inside of Mangement Studio or Enterprise Manager
for all 3 instances of the database (original MDF file from SQL 2000 was
copied and attached to SQL 2005 and 2005 Express)
When I run VB6 application against SQL Express database the recordset
contains NULL in one of the fields. No NULL value in all other cases.

What is the difference? Why it might happen?
Although it might not help to understand what's going on there I decided to
give the thext of my statement:

strSoldToSQL = "SELECT Account.AccountName + ' (ID = ' +
CAST(Account.AccountID AS varchar(5)) + ')' AS SoldTo, " & _
"AccountName AS CustomerForQB, Sopa.JobID AS JobID, Sopa.JobName,
Account.AccountID, " & _
"COALESCE (QBAccountCustomer.ListID, '') AS SoldToQBListID, " & _
"COALESCE (dbo.QBSopaJob.ListID, '') AS SopaQBListID " & _
"FROM Ordr RIGHT OUTER JOIN OrderDetail ON " & _
"Ordr.OrderID = OrderDetail.OrderID RIGHT OUTER JOIN " & _
"[Partial] ON OrderDetail.OrderDetailID = [Partial].OrderDetailID "
& _
"LEFT OUTER JOIN Sopa LEFT OUTER JOIN QBSopaJob ON " & _
"Sopa.JobID = QBSopaJob.JobID ON Ordr.JobID = Sopa.JobID " & _
"LEFT OUTER JOIN Account LEFT OUTER JOIN QBAccountCustomer ON " & _
"Account.AccountID = QBAccountCustomer.AccountID ON " & _
"Sopa.LowBidderID = Account.AccountID " & _
"WHERE Partial.PartialID = " & lngPartialID

Set rsSoldTo = New ADODB.Recordset
rsSoldTo.Open strSoldToSQL, objConn, adOpenStatic, adLockOptimistic

The field Sopa.JobID contains NULL

Thank you

vovan

 >> Stay informed about: Difference between version 
Back to top
Login to vote
vovan

External


Since: Jul 16, 2007
Posts: 15



(Msg. 2) Posted: Sat Feb 16, 2008 12:29 pm
Post subject: Re: Difference between version [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I found the way to fix it:
I replaced Sopa.JobID AS JobID with Sopa.JobID AS SopaJobID
It works now, but I still do not understand why it did not work with the
previous syntax.

Thank you
vovan

"vovan" wrote in message

>I have SELECT statement in VB6 application. It is used to populate
>ADODB.Recordset.
> It works fine when I connect to SQL 2000 and SQL 2005 databases. It works
> fine as well if I run it inside of Mangement Studio or Enterprise Manager
> for all 3 instances of the database (original MDF file from SQL 2000 was
> copied and attached to SQL 2005 and 2005 Express)
> When I run VB6 application against SQL Express database the recordset
> contains NULL in one of the fields. No NULL value in all other cases.
>
> What is the difference? Why it might happen?
> Although it might not help to understand what's going on there I decided
> to give the thext of my statement:
>
> strSoldToSQL = "SELECT Account.AccountName + ' (ID = ' +
> CAST(Account.AccountID AS varchar(5)) + ')' AS SoldTo, " & _
> "AccountName AS CustomerForQB, Sopa.JobID AS JobID, Sopa.JobName,
> Account.AccountID, " & _
> "COALESCE (QBAccountCustomer.ListID, '') AS SoldToQBListID, " & _
> "COALESCE (dbo.QBSopaJob.ListID, '') AS SopaQBListID " & _
> "FROM Ordr RIGHT OUTER JOIN OrderDetail ON " & _
> "Ordr.OrderID = OrderDetail.OrderID RIGHT OUTER JOIN " & _
> "[Partial] ON OrderDetail.OrderDetailID = [Partial].OrderDetailID "
> & _
> "LEFT OUTER JOIN Sopa LEFT OUTER JOIN QBSopaJob ON " & _
> "Sopa.JobID = QBSopaJob.JobID ON Ordr.JobID = Sopa.JobID " & _
> "LEFT OUTER JOIN Account LEFT OUTER JOIN QBAccountCustomer ON " & _
> "Account.AccountID = QBAccountCustomer.AccountID ON " & _
> "Sopa.LowBidderID = Account.AccountID " & _
> "WHERE Partial.PartialID = " & lngPartialID
>
> Set rsSoldTo = New ADODB.Recordset
> rsSoldTo.Open strSoldToSQL, objConn, adOpenStatic, adLockOptimistic
>
> The field Sopa.JobID contains NULL
>
> Thank you
>
> vovan
>
>

 >> Stay informed about: Difference between version 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Difference between MSDE 7 and SQL 7 - Is there a registry key that will tell me if am running MSDE 7 or MS SQL 7? Thanks

Differences in ANSI SQL and MSDE Options - I have a database, and I want to run an update script on it. I understand ANSI standard script. I've used Oracle 10g to learn databases, and I've used C# for a while now with SQLCommand, SQLConnection, etc. Now, I'm trying to update a SQL Server (I..

What is the difference between MSDE and a full-blown SQL i.. - Do I use the SQL Server CD to install both?

which version for development? - I'm completely confused at the many versions of SQLServer, and I need some advice here. I'm a web developer and up to recently, I developed on my XP Prof machine using MSSQL7. Now I need to develop for MSSQL2000 as well as for MSDE2000. I have a ..

version question -
   Database Forums (Home) -> MSDE All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]