Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Thursday, March 22, 2012

AdventureWorks db for 101 Samples

I'm not sure if this should be asked here. If it's the wrong place, let me know and I'll correct.
I've just downloaded 101 Samples for Visual Studio 2005. But the data access samples require AdventureWorks database which is not included in the C# sample. Who know where I can get this database? It is a SQL 2005 database, I think.
Thanks!

You can download AdventureWorks from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en

|||Thanks a lot, Gail!|||I'm using the version of SQL Server 2005 Express that comes together with Visual Studio 2005 Beta 2. When I try to attach the AventureWorks db, there is an error.


The database 'AdventureWorks' cannot be opened because it is version 607. This server supports version 603 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)


What version of SQL Server 2005 is required? Could it work with my VS.NET 2005 Beta 2?
Thanks!|||Hi blackpuppy,
You'll need the June CTP version of SQL Server Express, which will work just fine with your VS Beta 2. You can download that version from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=1A722B0F-6CCA-4E8B-B6EA-12D9C450ED92&displaylang=en

Before you install SQL Server Express, using Control Panel | Add/Remove Programs to uninstall your current version of .NET Framework 2.0.

Install the version of .NET Framework 2.0 from the SQL Server Express download site and then install SQL Server Express.|||Are you saying that instead of installing appropriate version of AdventureWorks, sql server 2005 Express has to be installed (downloaded from the internet)? I got installation of sql server 2005 CTP from Microsoft, after attending webcast sessions, and it didn't include AdventureWorks database. Now I'm trying to learn something about 2005, and sample database would really help. I don't want to reinstall Express because it won't include all tools I need for learning.
Is it possible to download somewhere appropriate version of this sample database?
Thanks,
Edi|||

What I'm asking is is there anywhere older copy of AdventureWorks, compatible with Sqlserver 2005 CTP?
Thanks

|||

The version of AdventureWorks at this site : http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en
is the appropriate version for SQL Server 2005 June CTP release and SQL Server Express 2005 June CTP.

If your version of SQL Server is older than that, then you may have problems using the sample database available from this site. However, it's not clear to me what version of SQL Server you really have or whether you have SQL Server Express or the Developer edition of SQL Server. Can you run SELECT @.@.VERSION and report back the result? This will identify your SQL Server version and help solve the issue.

|||Well... I have SQL Server 2005 Express Loaded from the June CTP (version 9.00.1128.00) and the above AdventureWorks and it still doesn't work!!!

I still get the error above!... Is there anything else that would work? or better yet are there any other samples out there to down load?

thanks,
ward0093|||

Okay. I've forwarded this to the samples team for further investigation. I'll report back when I get morre information.

In the meantime, if you want other sample databases, you can certainly download and install the pubs and northwind sample databaes from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en

|||Thanks Gail....

I got it working on my Laptop by still not be development machine... and it was the same install for both machines.

Not sure what the deal is

ward0093|||How did you get it working? I am experiencing the same problem and was unable to install a different version of sql express after uninstalling the version that is bundled with VS beta 2.|||

I just downloaded the samples, and the adventureworksdb. The db doesn't have the sample table layout as the samples. The new version is highly normalized. Is there somewhere to get the older db?

Thanks.

|||

I don't understand what you mean by "The db doesn't have the sample table layout as the samples. " Can you be more specific? The database schema has not changed since the June CTP version, so I'm not sure what you're referring to.

Thanks.

|||

gaile-

Thanks for your quick response. Specifically, from CreatingMasterDetails sample:

SELECT EmployeeID, NationalIDNumber, ContactID, LoginID, DepartmentID, ManagerID, ShiftID, Title, EmergencyContactID, AddressID, BirthDate, MaritalStatus, Gender, HireDate, SalariedFlag, BaseRate, PayFrequency, VacationHours, SickLeaveHours, CurrentFlag, rowguid, ModifiedDate FROM HumanResources.Employee WHERE (EmployeeID = @.@.IDENTITY)

Several of these fields are not in the employee table (DepartmentID, ShiftID, AddressID...). Is the db different for express and server? The downloaded msi's are the same size. I'm using SQLServer2005.

Thanks.

-Gary

sql

AdventureWorks db for 101 Samples

I'm not sure if this should be asked here. If it's the wrong place, let me know and I'll correct.
I've just downloaded 101 Samples for Visual Studio 2005. But the data access samples require AdventureWorks database which is not included in the C# sample. Who know where I can get this database? It is a SQL 2005 database, I think.
Thanks!

You can download AdventureWorks from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en

|||Thanks a lot, Gail!|||I'm using the version of SQL Server 2005 Express that comes together with Visual Studio 2005 Beta 2. When I try to attach the AventureWorks db, there is an error.


The database 'AdventureWorks' cannot be opened because it is version 607. This server supports version 603 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)


What version of SQL Server 2005 is required? Could it work with my VS.NET 2005 Beta 2?
Thanks!

|||Hi blackpuppy,
You'll need the June CTP version of SQL Server Express, which will work just fine with your VS Beta 2. You can download that version from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=1A722B0F-6CCA-4E8B-B6EA-12D9C450ED92&displaylang=en

Before you install SQL Server Express, using Control Panel | Add/Remove Programs to uninstall your current version of .NET Framework 2.0.

Install the version of .NET Framework 2.0 from the SQL Server Express download site and then install SQL Server Express.|||Are you saying that instead of installing appropriate version of AdventureWorks, sql server 2005 Express has to be installed (downloaded from the internet)? I got installation of sql server 2005 CTP from Microsoft, after attending webcast sessions, and it didn't include AdventureWorks database. Now I'm trying to learn something about 2005, and sample database would really help. I don't want to reinstall Express because it won't include all tools I need for learning.
Is it possible to download somewhere appropriate version of this sample database?
Thanks,
Edi|||

What I'm asking is is there anywhere older copy of AdventureWorks, compatible with Sqlserver 2005 CTP?
Thanks

|||

The version of AdventureWorks at this site : http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en
is the appropriate version for SQL Server 2005 June CTP release and SQL Server Express 2005 June CTP.

If your version of SQL Server is older than that, then you may have problems using the sample database available from this site. However, it's not clear to me what version of SQL Server you really have or whether you have SQL Server Express or the Developer edition of SQL Server. Can you run SELECT @.@.VERSION and report back the result? This will identify your SQL Server version and help solve the issue.

|||Well... I have SQL Server 2005 Express Loaded from the June CTP (version 9.00.1128.00) and the above AdventureWorks and it still doesn't work!!!

I still get the error above!... Is there anything else that would work? or better yet are there any other samples out there to down load?

thanks,
ward0093|||

Okay. I've forwarded this to the samples team for further investigation. I'll report back when I get morre information.

In the meantime, if you want other sample databases, you can certainly download and install the pubs and northwind sample databaes from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en

|||Thanks Gail....

I got it working on my Laptop by still not be development machine... and it was the same install for both machines.

Not sure what the deal is

ward0093|||How did you get it working? I am experiencing the same problem and was unable to install a different version of sql express after uninstalling the version that is bundled with VS beta 2.|||

I just downloaded the samples, and the adventureworksdb. The db doesn't have the sample table layout as the samples. The new version is highly normalized. Is there somewhere to get the older db?

Thanks.

|||

I don't understand what you mean by "The db doesn't have the sample table layout as the samples. " Can you be more specific? The database schema has not changed since the June CTP version, so I'm not sure what you're referring to.

Thanks.

|||

gaile-

Thanks for your quick response. Specifically, from CreatingMasterDetails sample:

SELECT EmployeeID, NationalIDNumber, ContactID, LoginID, DepartmentID, ManagerID, ShiftID, Title, EmergencyContactID, AddressID, BirthDate, MaritalStatus, Gender, HireDate, SalariedFlag, BaseRate, PayFrequency, VacationHours, SickLeaveHours, CurrentFlag, rowguid, ModifiedDate FROM HumanResources.Employee WHERE (EmployeeID = @.@.IDENTITY)

Several of these fields are not in the employee table (DepartmentID, ShiftID, AddressID...). Is the db different for express and server? The downloaded msi's are the same size. I'm using SQLServer2005.

Thanks.

-Gary

AdventureWorks db for 101 Samples

I'm not sure if this should be asked here. If it's the wrong place, let me know and I'll correct.
I've just downloaded 101 Samples for Visual Studio 2005. But the data access samples require AdventureWorks database which is not included in the C# sample. Who know where I can get this database? It is a SQL 2005 database, I think.
Thanks!

You can download AdventureWorks from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en

|||Thanks a lot, Gail!|||I'm using the version of SQL Server 2005 Express that comes together with Visual Studio 2005 Beta 2. When I try to attach the AventureWorks db, there is an error.


The database 'AdventureWorks' cannot be opened because it is version 607. This server supports version 603 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)


What version of SQL Server 2005 is required? Could it work with my VS.NET 2005 Beta 2?
Thanks!|||Hi blackpuppy,
You'll need the June CTP version of SQL Server Express, which will work just fine with your VS Beta 2. You can download that version from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=1A722B0F-6CCA-4E8B-B6EA-12D9C450ED92&displaylang=en

Before you install SQL Server Express, using Control Panel | Add/Remove Programs to uninstall your current version of .NET Framework 2.0.

Install the version of .NET Framework 2.0 from the SQL Server Express download site and then install SQL Server Express.|||Are you saying that instead of installing appropriate version of AdventureWorks, sql server 2005 Express has to be installed (downloaded from the internet)? I got installation of sql server 2005 CTP from Microsoft, after attending webcast sessions, and it didn't include AdventureWorks database. Now I'm trying to learn something about 2005, and sample database would really help. I don't want to reinstall Express because it won't include all tools I need for learning.
Is it possible to download somewhere appropriate version of this sample database?
Thanks,
Edi|||

What I'm asking is is there anywhere older copy of AdventureWorks, compatible with Sqlserver 2005 CTP?
Thanks

|||

The version of AdventureWorks at this site : http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en
is the appropriate version for SQL Server 2005 June CTP release and SQL Server Express 2005 June CTP.

If your version of SQL Server is older than that, then you may have problems using the sample database available from this site. However, it's not clear to me what version of SQL Server you really have or whether you have SQL Server Express or the Developer edition of SQL Server. Can you run SELECT @.@.VERSION and report back the result? This will identify your SQL Server version and help solve the issue.

|||Well... I have SQL Server 2005 Express Loaded from the June CTP (version 9.00.1128.00) and the above AdventureWorks and it still doesn't work!!!

I still get the error above!... Is there anything else that would work? or better yet are there any other samples out there to down load?

thanks,
ward0093|||

Okay. I've forwarded this to the samples team for further investigation. I'll report back when I get morre information.

In the meantime, if you want other sample databases, you can certainly download and install the pubs and northwind sample databaes from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en

|||Thanks Gail....

I got it working on my Laptop by still not be development machine... and it was the same install for both machines.

Not sure what the deal is

ward0093|||How did you get it working? I am experiencing the same problem and was unable to install a different version of sql express after uninstalling the version that is bundled with VS beta 2.|||

I just downloaded the samples, and the adventureworksdb. The db doesn't have the sample table layout as the samples. The new version is highly normalized. Is there somewhere to get the older db?

Thanks.

|||

I don't understand what you mean by "The db doesn't have the sample table layout as the samples. " Can you be more specific? The database schema has not changed since the June CTP version, so I'm not sure what you're referring to.

Thanks.

|||

gaile-

Thanks for your quick response. Specifically, from CreatingMasterDetails sample:

SELECT EmployeeID, NationalIDNumber, ContactID, LoginID, DepartmentID, ManagerID, ShiftID, Title, EmergencyContactID, AddressID, BirthDate, MaritalStatus, Gender, HireDate, SalariedFlag, BaseRate, PayFrequency, VacationHours, SickLeaveHours, CurrentFlag, rowguid, ModifiedDate FROM HumanResources.Employee WHERE (EmployeeID = @.@.IDENTITY)

Several of these fields are not in the employee table (DepartmentID, ShiftID, AddressID...). Is the db different for express and server? The downloaded msi's are the same size. I'm using SQLServer2005.

Thanks.

-Gary

AdventureWorks db for 101 Samples

I'm not sure if this should be asked here. If it's the wrong place, let me know and I'll correct.
I've just downloaded 101 Samples for Visual Studio 2005. But the data access samples require AdventureWorks database which is not included in the C# sample. Who know where I can get this database? It is a SQL 2005 database, I think.
Thanks!

You can download AdventureWorks from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en

|||Thanks a lot, Gail!|||I'm using the version of SQL Server 2005 Express that comes together with Visual Studio 2005 Beta 2. When I try to attach the AventureWorks db, there is an error.


The database 'AdventureWorks' cannot be opened because it is version 607. This server supports version 603 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)


What version of SQL Server 2005 is required? Could it work with my VS.NET 2005 Beta 2?
Thanks!

|||Hi blackpuppy,
You'll need the June CTP version of SQL Server Express, which will work just fine with your VS Beta 2. You can download that version from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=1A722B0F-6CCA-4E8B-B6EA-12D9C450ED92&displaylang=en

Before you install SQL Server Express, using Control Panel | Add/Remove Programs to uninstall your current version of .NET Framework 2.0.

Install the version of .NET Framework 2.0 from the SQL Server Express download site and then install SQL Server Express.|||Are you saying that instead of installing appropriate version of AdventureWorks, sql server 2005 Express has to be installed (downloaded from the internet)? I got installation of sql server 2005 CTP from Microsoft, after attending webcast sessions, and it didn't include AdventureWorks database. Now I'm trying to learn something about 2005, and sample database would really help. I don't want to reinstall Express because it won't include all tools I need for learning.
Is it possible to download somewhere appropriate version of this sample database?
Thanks,
Edi|||

What I'm asking is is there anywhere older copy of AdventureWorks, compatible with Sqlserver 2005 CTP?
Thanks

|||

The version of AdventureWorks at this site : http://www.microsoft.com/downloads/details.aspx?FamilyID=2adbc1a8-ae5c-497d-b584-eab6719300cd&DisplayLang=en
is the appropriate version for SQL Server 2005 June CTP release and SQL Server Express 2005 June CTP.

If your version of SQL Server is older than that, then you may have problems using the sample database available from this site. However, it's not clear to me what version of SQL Server you really have or whether you have SQL Server Express or the Developer edition of SQL Server. Can you run SELECT @.@.VERSION and report back the result? This will identify your SQL Server version and help solve the issue.

|||Well... I have SQL Server 2005 Express Loaded from the June CTP (version 9.00.1128.00) and the above AdventureWorks and it still doesn't work!!!

I still get the error above!... Is there anything else that would work? or better yet are there any other samples out there to down load?

thanks,
ward0093|||

Okay. I've forwarded this to the samples team for further investigation. I'll report back when I get morre information.

In the meantime, if you want other sample databases, you can certainly download and install the pubs and northwind sample databaes from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en

|||Thanks Gail....

I got it working on my Laptop by still not be development machine... and it was the same install for both machines.

Not sure what the deal is

ward0093|||How did you get it working? I am experiencing the same problem and was unable to install a different version of sql express after uninstalling the version that is bundled with VS beta 2.|||

I just downloaded the samples, and the adventureworksdb. The db doesn't have the sample table layout as the samples. The new version is highly normalized. Is there somewhere to get the older db?

Thanks.

|||

I don't understand what you mean by "The db doesn't have the sample table layout as the samples. " Can you be more specific? The database schema has not changed since the June CTP version, so I'm not sure what you're referring to.

Thanks.

|||

gaile-

Thanks for your quick response. Specifically, from CreatingMasterDetails sample:

SELECT EmployeeID, NationalIDNumber, ContactID, LoginID, DepartmentID, ManagerID, ShiftID, Title, EmergencyContactID, AddressID, BirthDate, MaritalStatus, Gender, HireDate, SalariedFlag, BaseRate, PayFrequency, VacationHours, SickLeaveHours, CurrentFlag, rowguid, ModifiedDate FROM HumanResources.Employee WHERE (EmployeeID = @.@.IDENTITY)

Several of these fields are not in the employee table (DepartmentID, ShiftID, AddressID...). Is the db different for express and server? The downloaded msi's are the same size. I'm using SQLServer2005.

Thanks.

-Gary

Monday, March 19, 2012

Advanced Transact_SQL

Hi everyone
I've a problem. I must convert a query dinamically composed in an ASP
script, in a stored procedure
The Visual Basic code is below.
Could you help me anyway?
SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
if(new_titolo <> "") then
mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
end if
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
if((da <> "" AND a <> "")) then
mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
end if
mySQL=trim(mySQL)
' tolgo eventuali AND finali
if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
AN") then
mySQL=mid(mySQL,1,len(mySQL)-3)
end if
mySQL=mySQL & " order by data DESC"
Thank you very much
Hi
"elisacarli" wrote:

> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>
Check out http://www.sommarskog.se/dyn-search.html
John
|||in the following your string is not properly closed
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
this should be
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & "%' AND "
futher you are cheking whether the SQL string end with "AND" if true you're
removing it. but if all the three conditions fails "WHERE" clouse will throw
you an error. So try to remove the "WHERE" clouse in the "SELECT" statment is
no condition were met.
Otherwise you can include a dumy condition to avoid the error.
"SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE ID > 0 "
"elisacarli" wrote:

> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>

Advanced Transact_SQL

Hi everyone
I've a problem. I must convert a query dinamically composed in an ASP
script, in a stored procedure
The Visual Basic code is below.
Could you help me anyway?
SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
if(new_titolo <> "") then
mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
end if
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
if((da <> "" AND a <> "")) then
mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
end if
mySQL=trim(mySQL)
' tolgo eventuali AND finali
if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
AN") then
mySQL=mid(mySQL,1,len(mySQL)-3)
end if
mySQL=mySQL & " order by data DESC"
Thank you very muchHi
"elisacarli" wrote:

> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>
Check out http://www.sommarskog.se/dyn-search.html
John|||in the following your string is not properly closed
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
this should be
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & "%' AND "
futher you are cheking whether the SQL string end with "AND" if true you're
removing it. but if all the three conditions fails "WHERE" clouse will throw
you an error. So try to remove the "WHERE" clouse in the "SELECT" statment i
s
no condition were met.
Otherwise you can include a dumy condition to avoid the error.
"SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE ID > 0 "
"elisacarli" wrote:

> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>

Advanced Transact_SQL

Hi everyone
I've a problem. I must convert a query dinamically composed in an ASP
script, in a stored procedure
The Visual Basic code is below.
Could you help me anyway?
SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
if(new_titolo <> "") then
mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
end if
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
if((da <> "" AND a <> "")) then
mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
end if
mySQL=trim(mySQL)
' tolgo eventuali AND finali
if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
AN") then
mySQL=mid(mySQL,1,len(mySQL)-3)
end if
mySQL=mySQL & " order by data DESC"
Thank you very muchHi
"elisacarli" wrote:
> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>
Check out http://www.sommarskog.se/dyn-search.html
John|||in the following your string is not properly closed
if(new_sottotitolo <> "") then
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
end if
this should be
mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & "%' AND "
futher you are cheking whether the SQL string end with "AND" if true you're
removing it. but if all the three conditions fails "WHERE" clouse will throw
you an error. So try to remove the "WHERE" clouse in the "SELECT" statment is
no condition were met.
Otherwise you can include a dumy condition to avoid the error.
"SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE ID > 0 "
"elisacarli" wrote:
> Hi everyone
> I've a problem. I must convert a query dinamically composed in an ASP
> script, in a stored procedure
> The Visual Basic code is below.
> Could you help me anyway?
> SELECT ID,titolo,sottotitolo,data,file FROM tbl_promozioni WHERE
> if(new_titolo <> "") then
> mySQL=mySQL & "titolo LIKE '%" & new_sottotitolo & "%' AND "
> end if
> if(new_sottotitolo <> "") then
> mySQL=mySQL & "sottotitolo LIKE '%" & new_sottotitolo & AND "
> end if
> if((da <> "" AND a <> "")) then
> mySQL=mySQL & "(((data)>=#"& da & "#) AND ((data)<=#"& a & "#))"
> end if
> mySQL=trim(mySQL)
> ' tolgo eventuali AND finali
> if(mid(mySQL,len(mySQL)-3,3)="AND" or mid(mySQL,len(mySQL)-3,3)="
> AN") then
> mySQL=mid(mySQL,1,len(mySQL)-3)
> end if
> mySQL=mySQL & " order by data DESC"
> Thank you very much
>

Advanced Search box

ConfusedHi, Using Visual Web Developer and SQL Express, (coding in Csharp) I want to add a

advanced search facility to my site. Problem is I do not know how to begin.

The website is a business directory and displays company names and services that they provide.

Here is where I am at...

So far I have made one query whichallows users to search the database by "town" such as if they enter "London" in the text box, it returns the relevant records into a gridview.

Rather than have a seperate text box for each query, I want to provide an advanced search box option so users can define their search and query the database by various criterias, such as geography, sector, name, number of employees in companies etc.

I have seen compact advanced search boxes on many sites!.

Replies greatly appreciated.

prontonet

You can use a query with multiple search criterials, and 'disable' a search criterial when the input parameter is null. For example:

USE Northwind
DECLARE @.EId int, @.CId varchar(20)
SET @.EID=6
SELECT *
FROM Orders
WHERE EmployeeID=isnull(@.EId,EmployeeID)
AND CustomerID=isnull(@.CId,CustomerID)

Here we make a trick by using ISNULL function to return the self value of a field if the parameter is null. So in your code, just pass null values to the parameters when corresponding textbox is empty.

|||

Mnay Thanks for your reply. Can you give me another example - somehow not quite

following it yet??

|||Sorry I'm not not clear. Can you explain more about the example you want?|||

easiest way to explain is to give an example of what I would like a user to be able to do

Say I have 1000 companies in my database, then I want to give the user multiple search options

to retrieve only the data they need but in a compact way - As opposed to making a seperate text box for each search criteria which takes up a lot of space on the web page.

Ideally I want the user to be able to select or tick (from a dropdown or (checkbox) which

critieria they are searching by and then enter just enter any text into single box and just hit the search button.

I have included example criterias below...

Search Criteria 1 (By town)

Search Criteria 2 (by Industry sector)

Search Criteria 3 (by number of employees in company

Search Criteria 4 (company ID)

There could be more, also Ideally I would want them also to be able to filter the search further so they can for example select - "companies in "London" with "100+ employees", and that trade in the "technology sector"

I almost understand your example put maybe if you could put it into the above context

that would help. once again I am using visual web developer and Csharp.

Thanks

|||

Im really looking forward to an answer to this. Im stuck on the same thing......

Some1 plz help !!! With an example......

|||

OK, let's look at a simple example. Suppose we have a table as following in database:

CREATE TABLE Companies(ComID int PRIMARY KEY, town nvarchar(100),
IndustrySector nvarchar(50),NumOfEmployees int)

And we have 4 TextBoxes in application used for inputting search criterials. Then we can use such code:

using (SqlConnection conn = new SqlConnection(@."Data Source=.\IORI2000;Integrated Security=SSPI;Database=tempdb"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM Companies WHERE town=isnull(@.town,town)AND Industrysector=isnull(@.zInSec,Industrysector)AND NumOfEmployees>=@.NOE AND ComID=isnull(@.ComID,ComID)", conn);

cmd.Parameters.Add("@.town", SqlDbType.NVarChar, 100);
cmd.Parameters.Add("@.zInSec", SqlDbType.NVarChar, 50);
cmd.Parameters.Add("@.NOE", SqlDbType.Int);
cmd.Parameters.Add("@.ComID", SqlDbType.Int);
if (textBox1.Text.Length == 0)
cmd.Parameters["@.town"].Value = DBNull.Value;
else
cmd.Parameters["@.town"].Value = textBox1.Text;
if (textBox2.Text.Length == 0)
cmd.Parameters["@.zInSec"].Value = DBNull.Value;
else
cmd.Parameters["@.zInSec"].Value = textBox2.Text;

cmd.Parameters["@.NOE"].Value = textBox3.Text.Length == 0 ? 0 : Int32.Parse(textBox3.Text);
if (textBox4.Text.Length == 0)
cmd.Parameters["@.ComID"].Value = DBNull.Value;
else
cmd.Parameters["@.ComID"].Value = Int32.Parse(textBox4.Text);

SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
label1.Text= dt.Rows.Count.ToString();
}

|||Thanks so much. How can I use this same example to search more then one column based on a single textbox.|||

That's something you need to implement from your code. For example you can validate the input text of a textbox so that the search criterals are delimited by some chars (such as ';' in connection string), and then split the text into a string array. In this case I prefer dynamic SQL built from concatenated basic SELECT command and WHERE clause. Ok let's take a look at how to build dynamic SQL command:

using (SqlConnection conn= new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{
conn.Open();
string qstring = "SELECT * FROM Orders WHERE";

string[] sa = TextBox2.Text.Split('#');
if (sa.Length == 0)
Response.Write("No correct search criterials!");
else
foreach (string s in sa)
qstring += s+" AND ";
qstring=qstring.Remove(qstring.Length - 4);
SqlCommand cmd = new SqlCommand(qstring, conn);

//add your code

}

But keep in mind: dynamic SQL without using Parameters may suffer from SQL Injection. We should always use parameterized query.

Tuesday, March 6, 2012

AdomdClient: Which sequence belongs to which cluster?

Hi,

We are using Microsoft Sequence Clustering both "manually" via Visual Studio (SQL Server Business Intelligence Development Studio) and "programatically" via AMO and ADOMD.NET (using C#). We use AMO to build and process the MiningModel, and ADOMD.NET (Microsoft.AnalysisServices.AdomdClient) to browse through results.

Everything is working fine except for a very important detail: we can't find where the MiningModel stores cluster membership. The MiningModel.Content contains a column NODE_SUPPORT which shows how many sequences there are in each cluster, but we can't find which sequence belongs to which cluster.

In Visual Studio, the Microsoft Sequence Cluster Viewer is able to show this in Cluster Profiles (a right-click on a cluster followed by Show Legend lists the sequences that belong to that cluster).

Question is: where does the Viewer get this information, and how can we get it via ADOMD? Or via AMO, if that's the case?

Would appreciate your assistance.

Kind Regards,

Diogo

You can use the Cluster() function in a prediction query to get this information. As you probably know by now, you should construct the query and set it as the CommandText of an AdomdCommand object.

Alternatively, you may find it easier to navigate the results by using Cluster() as a column reference in PredictHistogram() and flatten the result set:

SELECT FLATTENED (PredictHistogram(Cluster() ...)

|||

It seems that in order to determine cluster membership we must write a prediction query over the same data that served as training input. Is it easy to write such a query? Can you provide us with an example? Or the general form of such query?

Also while creating the mining model I haven't marked any column as "predictable". I guess I should do that, right?

Thanks!

|||

The query is indeed very simple, here is the general form:

SELECT Cluster(), t.caseid FROM MyMiningModel
NATURAL PREDICTION JOIN (SELECT * FROM MyMiningModel.CASES) as t
ORDER BY Cluster()

The posts from Jamie in this thread were particularly useful:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1035151&SiteID=1

Problem solved! Thanks for the hint!

ADOMD.NET 8.0 dependencies for connecting to both AS 2000 and AS 2005

I've got a C# application developed with Visual Studio .Net 2003 which uses Adomd.net (8.0) to access cubes on SQL Server 2000 Analysis Services as well as SQL Server 2005 Analysis Services. In the MSDN reference page I noticed that I can set the connection parameter "ConnectTo=Default", and now, after installing the SQL Server 2005 Client Connectivity components, I can make connections to both AS2K and AS2K5 from my development machine (XP SP2).

However, I can't figure out the dependencies to make this work on other systems. On another XP SP2 system (pretty bare-bones), if I install either the SQL Server 2000 or 2005 Client Connectivity components, I can connect to AS2K5, but when I try connecting to AS2K, I get:

AdomdConnectionException: A connection cannot be made. Ensure that the server is running. --> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.

Following another thread in this forum, I tried installing PTSLITE for AS2K, but that had no effect.

On another XP SP2 system, with SQL Server 2000 client components, AS2K connections work but AS2K5 connections fail silently.

On a Win2K machine, AS2K5 connections work, but trying AS2K results in "AdomdErrorResponseException: The provider could not determine the value."

Can anyone tell me the essential prerequisites for making both connections? Thanks!

There are several components that are getting invoked to establish connection to different servers. You might need to try to see if each one of the is working separately.

1. Connection to AS 2005.

You can use ADOMD.NET 9 by installing Microsoft ADOMD.NET

from http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

2. Connection to AS 2000

ADOMD.NET is using AS OLEDB 8.0 ( MSOLAP.2) OLE DB provider to connect to AS 2000.

After installing ptslite.exe (Microsoft SQL Server 2000 PivotTable Services ) from http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en you can test if you can establish connection to AS 2000 by using MDX Sample application ( shipped with AS 2000)

ADOMD.NET v 9 is avaliable for download from the same page.

For your reference. The installation folder for ADOMD.NET is %SystemDrive%\Program Files\Microsoft.NET\ADOMD.NET\

There you fill find 80 or 90 sub-folders for correspodingly ADOMD.NET v8 and v9.

Hope using this information you will be able to troublshoot what is going on.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights

|||

Thanks for the response.

However, I believe ADOMD.NET 9.0 depends on Framework 2.0, and I'm not ready to upgrade to Visual Studio 2005 just yet. I've been able to connect to AS2005 without it anyway.

I tried downloading the latest version of ptslite, but it still says the AS 2000 server "actively refused the connection".

|||

Also, does the .NET Framework cache the OLEDB providers? I've tried unregistering/renaming C:\Program Files\Common Files\System\Oledb\msolap80.dll to verify dependence, but the application connectivity still works the same!

I'm still not close to getting dual connectivity to work properly, so any suggestions are appreciated!

|||

To troubleshoot connectivity issues I would start from trying to establish connection to AS2000 using MDX Sample appication.
It is going to use AS OLEDB 8 ( MSOLAP.2 ) to connect.

See if you can copy MDX Sample app to your client machine and you can establish connection from there.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights

|||

Well, I'm making a little progress. I finally realized that one test XP system wasn't able to connect to AS 2000 because I wasn't logged into it with a domain account, so it didn't have permission to access the cubes. That doesn't explain why it was able to access our AS 2005 system, though!

That brings me to the issue of my Windows 2000 test system. Logged into it with a domain account, the MDX Sample App works fine, but my .NET application still can't connect to AS 2000. (It still says "Exception: The provider could not determine the value.") It does connect to AS 2005, though. I verified in C:\Winnt\assembly that Microsoft.AnalysisServices.AdomdClient is version 8.0.700, the same as on my XP systems.

Any further suggestions? Thanks!

|||

hello Jon,

the list of pre-requisites for the adomd.net 8.0 is (as from the readme file):

* Microsoft .NET Framework Class Library 1.0 SP2 or greater

* MSXML 4.0 or greater

* AS2000 OLE DB provider required for Microsoft Analysis Services 2000 data access

so, i'd check on msxml4.0 if msolap80 is definitelly present.

if that does not help, wrap up the connection.Open() into following block of code, to see if it could reveal more information about the error:

try

{

// code here

}

catch (Exception e)

{

Exception ex = e;

while (ex != null)

{

Debug.WriteLine("========Exception================");

Debug.WriteLine("Type: " + ex.GetType().FullName);

Debug.WriteLine("Message: " + ex.Message);

Debug.WriteLine("Stack :" + ex.StackTrace);

AdomdErrorResponseException errResponse = ex as

AdomdErrorResponseException;

AdomdConnectionException conException = ex as

AdomdConnectionException;

if (errResponse != null)

{

foreach (AdomdError r in errResponse.Errors)

{

Debug.WriteLine("::::ERROR::::");

Debug.WriteLine("code: " +

r.ErrorCode.ToString());

Debug.WriteLine("msg: " + r.Message);

}

}

else if (conException != null)

{

Debug.WriteLine("ExceptionCause:" +

conException.ExceptionCause.ToString());

}

ex = ex.InnerException;

}

} // catch

hope this helps,

|||

Thanks for the response, but I don't think those prerequisites are correct. I installed the PTSLITE package, which include msolap80.dll, but it didn't make any difference in the connectivity behavior on my one Windows 2003 system. Also, I ran the application in the debugger on XP and when a connection was made to AS 2000, the list of loaded modules did not include msolap80.dll or msxml4.dll.

I did find some more unexpected behavior, though: on both Windows 2000 and Wndows 2003, I'm not able to connect to some AS 2000 servers (running on Win2K), but I tried another AS 2000 server running on Windows 2003, and the connection works! When the connection fails, the error information is:

========Exception================

Type: Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException

Message: The provider could not determine the value.

Stack : at Microsoft.AnalysisServices.AdomdClient.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.AdomdConnection+IXmlaClientProviderEx.Discover(String requestType, String requestNamespace, IDictionary restrictions, Boolean throwOnErrors)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(String schemaName, String schemaNamespace, IDictionary adomdRestrictions)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(Guid schema, Object[] restrictions)
at DataSupport.OlapReader.GetOlapCatalogs(String source, Boolean useWinSecurity, String userID, String password)

::::ERROR::::

code: 8

msg: The provider could not determine the value

|||

hello Jon,

according to the stack trace, it looks like you were able to connect, but what fails is the schema rowset request (it seems that the call is to the GetSchemaDataSet....., not conneciton.Open)? is it so? if so, could you please provide more details as to the actual schema request, and restrictions provided?

thank you,

|||

You're right, I guess the connection.Open() succeeds, and it's GetSchemaDataSet() that doesn't behave consistently on all instances. We call it with the constant AdomdSchemaGuid.Catalogs and an empty array of restrictions.

I notice in the reference page for AdomdSchemaGuid a note that "Some members of the AdomdSchemaGuid class (such as the CATALOGS schema rowset) may not be supported by your provider." But shouldn't this be consistent on all installations of SQL Server 2000 Analysis Services and all clients? As I said originally, my Win XP development system can connect to (and get the list of catalogs from) all AS instances, and one Win 2003 system can do the same for all AS 2000 systems, but a Win 2000 system and one Win 2003 system can't get the list of catlogs for some AS 2000 systems (running on Win 2000).

The reference page also says, "Refer to your database documentation to determine whether you can retrieve this schema information using other techniques." What other techniques might work better?

|||

hello Jon,

good thing is that we now seems to have determined exactly which operation fails, and that connection seems to succeed.

yes, i think Catalogs schema should work with AS. it is not yet clear what exacty is wrong here. could you please paste the exact connection string you have for adomd.net when this fails. Also could you please clarify whether you connect to same AS server (i mean you say from some machines getting catalogs succeeds but from other fails, so what i'm trying to understand is whether you try to connect to same server in both cases). Also, is it the same user that connects (i.e. does it have same rights when successfull and when failure ?)

Also, just to try isolating the problem more, could you please run the following code and see what happens (and post all error details if failure happens):

try
{
using (OleDbConnection connection = new OleDbConnection())
{
connection.ConnectionString = "Provider=MSOLAP.2;<your same connection string as for adomd.net>";
connection.Open();

// should be similar restrictions and schema as for the adomd.net code
DataTable table = connection.GetOleDbSchemaTable(AdomdSchemaGuid.Catalogs, new object[0] { });
}
}
catch (Exception ex)
{
while (ex != null)
{
Debug.WriteLine("========Exception================");
Debug.WriteLine("Type: " + ex.GetType().FullName);
Debug.WriteLine("Message: " + ex.Message);
Debug.WriteLine("Stack :" + ex.StackTrace);

if (ex is OleDbException)
{
OleDbException oledb = ex as OleDbException;
foreach (OleDbError r in oledb.Errors)
{
Debug.WriteLine("::::ERROR::::");
Debug.WriteLine("code: " + r.NativeError.ToString());
Debug.WriteLine("msg: " + r.Message);
}
}
ex = ex.InnerException;
}

}

thank you,

|||

Mary:

The connection string we're using with the AdomdConnection object is "Data Source=as2kserver;Integrated Security=SSPI;ConnectTo=Default". It is the same in all cases, whether the GetSchemaDataSet() succeeds or not.

Trying the OleDbConnection method, I get the following error message for the servers that fail:

========OLEDB Exception==========
Type: System.InvalidOperationException
Message: The provider could not determine the Object value. For example, the row was just created, the default for the Object column was not available, and the consumer had not yet set a new Object value.
Stack : at System.Data.OleDb.DBBindings.get_Value()
at System.Data.OleDb.OleDbDataReader.GetValues(Object[] values)
at System.Data.OleDb.OleDbDataReader.DumpToTable(OleDbConnection connection, IRowset rowset)
at System.Data.OleDb.OleDbConnection.GetSchemaRowset(Guid schema, Object[] restrictions)
at System.Data.OleDb.OleDbConnection.GetOleDbSchemaTable(Guid schema, Object[] restrictions)
at DataSupport.OlapReader.GetOlapCatalogs(String source, Boolean useWinSecurity, String userID, String password)

|||

hello Jon,

then i have to conclude that this is somehow related to msolap80 (oledb provider for AS2000), since the code above used it directly and also fails with same error. so this does not seem like adomd.net specific issue. (adomd.net essentially uses msolap80 when working with AS2000)

in this case i would expect that MDXSample application when run from same box and connecting to same AS server should also fail enumerating catalogs. does it happen indeed?

can you double check on msolap80: is it properly registered? what's it's version? is the version the same as msolap80 has on the box that successfully enumerates catalogs?

thank you,

|||

Mary:

I just ran MDXSample on my Windows 2000 system and it connected to my AS 2000 server (on Win2000) and listed catalogs and cubes successfully, but my .NET application with your code using OleDb still failed in GetOleDbSchemaTable() with the same "provider could not determine the Object value" error. Both accessed another AS 2000 server (running on Windows 2003) successfully.

On that Win2000 client system, C:\WINNT\assembly shows Microsoft.AnalysisServices.AdomdClient as version 8.0.700.0, while the File version and Product Version of C:\Program Files\Microsoft.NET\Adomd.NET\80\Microsoft.AnalysisServices.AdomdClient.dll show as 8.0.702.0. When I search in regedit for "MSOLAP.2", it finds C:\Program Files\Common Files\System\OLE DB\msolap80.dll.

It seems like there's some slight difference between my AS 2000 servers that is only noticeable from a .NET application.

|||

Jon,

i don't have a clear picture of what's wrong exactly (apart from it being related to msolap80 itself, since the test with OleDbConnection.....), but i guess one needs to find what is different in the case when failure happens from when it succeeds.

i'd check on the following:

1. whether the same version (service pack) is installed: between the AS2000 server that the app fails against, and the AS2000 server that you said the app succeeds working with.

2. check on the version of ptslite that you installed on the box from which app works fine, and on the box from which connection to one of the AS2000 server does not work.

3. try to see if you have some client machine from which the app succeeds against that AS 2000 server (on Win2000) (against which the client machine in question fails).

4. maybe .net is different on the box from which client works ok comparing to .net version on the box where client app fails? (btw. is the app asp.net or winforms/console ? if it's asp.net, i'd try a small winforms/console app with just that oledb code to see if that makes any difference)

sorry for not being able to pinpoint the issue faster, but i think the key is to try and spot the difference between the boxes where it works and where it does not.

thanks,

adodb.connection > DBMS Name property equivalent in ADO.NET ...

Hi,

One of my team member was porting a Visual Basic function into VB.NET. We were struck up while retrieving the DBMS Name property from the connection object. Actually in VB, the ADODB.connection object's properties will have an item called DBMS Name which will hold the database name like "Oracle" , "Access" , "SQL Server" like that based on the database that I connect.

I wonder if there is any equivalent property in ADO.NET. The Server Version property of ODBCConnection object returns "8.0...." in case of SQL Server and returns "09.01.0000 Oracle9i Enterprise Edition Release 9.2.0.1.0" in case of oracle. This is not as precise as it's ADODB counterpart.

I'm hardly in need of a solution or workaround for this scenario. Can anybody help.

Thanks in advance.

Hi Prathap,

The .Net Framework Data Access and Storage forum is the best forum with which to seek your answer (I see that you've already posted this question there).

Il-Sung.

Sunday, February 19, 2012

ADO Recordsets object method Open

Hello group!

I use MS Visual C++ 6.0, ADO, MS SQL Server 2000.
When I attempt to open my database I meet with a following problem:
when I try to get a bookmark of the current record in a Recordset
object a following run-time error occurs: Unhandled exception in
testdb.exe(KERNEL32.DLL):
0xE06D7363: Microsoft C++ Exception.

I created my database by 3 SQL commands:

create database testdb
create table testtable
(
i int
)
insert into testtable values(0)

The error occurs in the following code snippet:
#import "D:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
int main()
{
CoInitialize(NULL);

bstr_t strCnn("Provider=sqloledb;Data Source=;"
"Initial Catalog=testdb;Trusted_Connection=YES;");

const char* tablename = "testtable";

_RecordsetPtr recs;
recs.CreateInstance(__uuidof(Recordset) );
recs -> Open(tablename, strCnn, adOpenStatic,
adLockOptimistic,adCmdTable);
_variant_t bm = recs -> Bookmark; // the error occurs here
recs -> Close();
CoUninitialize();
}

During the debugging this code I met that the error depended on a type
of locking. When I set adLockBatchOptimistic or adLockOptimistic
or adLockPessimistic the error occurs but when I set adLockReadOnly or
adLockUnspecified it doesn't occur. By the way this error doesn't
occur when
I open Pubs database with any type of locking. What is a cause of this
error?
Thank you.#import "D:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
int main()
{
CoInitialize(NULL);

bstr_t strCnn("Provider=sqloledb;Data Source=;"
"Initial Catalog=testdb;Trusted_Connection=YES;");

const char* tablename = "testtable";

_RecordsetPtr recs;
recs.CreateInstance(__uuidof(Recordset) );
recs -> Open(tablename, strCnn, adOpenStatic,
adLockOptimistic,adCmdTable);
bool r = recs -> Supports(adBookmark);
_variant_t bm = recs -> Bookmark; // the error occurs here
recs -> Close();
CoUninitialize();
}

If I opened testdb then recs -> Supports(adBookmark)
returned true when I used adLockReadOnly or adLockUnspecified. If I
used other
LockTypes then this function returned false and the error occured in
this line:
__variant_t bm = recs -> Bookmark; // the error occurs here

If I opened the Pubs database then recs -> Supports(adBookmark)
returned true for any LockType. Why does a Recordset object support
bookmark functionality for any LockType if I open the Pubs database?!
I can't understand it!!!

Thursday, February 16, 2012

ADO error creating database

im creating a ecommerce website, and i need to create a database, im using visual studio .net
and when i try to create a new database using VS.net i choose "use sql server authentication" and no matter what i type in for the login id, i get the following ado error

"ADO Error : ' Login failed for user "blank". Reason. Not associated with a trusted SQL server connection.'

thanks in advance.is the sql server on a different machine?|||no its on my machine. im using xp pro. is that ok? or am I trying to do something thats not possible?|||and you're sure you know a valid sql user name and password with decent rights, such as owner?|||just check ur connection string... It must contain clauses: uid=<the_login_to_ur_db>, pwd = <ur_password> and database=<ur_db_name>. If its not (this is really possible... I have encountered smth. like that...) then add it into connection string manualy divided with semicolon of course... It should help.

ADO Error Collection in VB With SQL Prints

In Visual Basic using ADO, I am trying to get print
statements from SQL into my VB project. How does query
analyzer get the print statements from the server? I am
able to display the first TWO print statements using the
[recordset].NextRecordset command, but I get an error if
I try to go past the second recordset. Please help if
you can.
[CODE]
Dim objerr As ADODB.Error
On Error GoTo err_check
Do
For Each objerr In gcn.Errors
GetSQLPrints = GetSQLPrints & vbCrLf &
objerr.Description
rs.NextRecordset
Next
Loop
[/CODE]
Only Prints two... I don't know why. Please help.It looks like you're executing a NextRecordset during your Errors collection
iteration. I suggest you complete the iteration before NextRecordset since
multiple messages can be returned along with a recordset.
Below is a VBScript example that shows one method to process multiple
recordsets with messages. In VB, another method is to handle the ADO
Connection InfoMessage event and process the messages in your event handler.
SqlScript = _
"PRINT 'test message 1'" & vbCrLf & _
"PRINT 'test message 2'" & vbCrLf & _
"SELECT 3" & vbCrLf & _
"PRINT 'test message 4'" & vbCrLf & _
"SELECT 5" & vbCrLf & _
"PRINT 'test message 6'" & vbCrLf
Set MyRecordset = MyConnection.Execute(SqlScript)
Message = ""
Do While Not MyRecordset Is Nothing
RecordsetNumber = RecordsetNumber + 1
Message = Message & "Recordset " & _
RecordsetNumber & ":" & VbCrLf
If MyConnection.Errors.Count > 0 Then
For Each SqlError In MyConnection.Errors
Message = Message & vbTab & "Message: " & _
SqlError.Description & vbCrLf
Next
Else
Message = Message & vbTab & _
"No messages." & vbCrLf
End If
If MyRecordset.State = adStateOpen Then
Message = Message & vbTab & _
"Rowset returned." & vbCrLf
Else
Message = Message & vbTab & _
"No rowset returned." & vbCrLf
End If
Message = Message & vbCrLf
Set MyRecordset = MyRecordset.NextRecordset
Loop
Message = Message & "Recordset is Nothing."
MyConnection.Close
MsgBox Message
Hope this helps.
Dan Guzman
SQL Server MVP
"Mike B" <BGates@.Microsoft.com> wrote in message
news:034801c3c671$449addf0$a101280a@.phx.gbl...
> In Visual Basic using ADO, I am trying to get print
> statements from SQL into my VB project. How does query
> analyzer get the print statements from the server? I am
> able to display the first TWO print statements using the
> [recordset].NextRecordset command, but I get an error if
> I try to go past the second recordset. Please help if
> you can.
> [CODE]
> Dim objerr As ADODB.Error
> On Error GoTo err_check
> Do
> For Each objerr In gcn.Errors
> GetSQLPrints = GetSQLPrints & vbCrLf &
> objerr.Description
> rs.NextRecordset
> Next
> Loop
> [/CODE]
> Only Prints two... I don't know why. Please help.|||For our connection, we are using SQLOLEDB...
When we run you code example, getting an error saying:
"Current Provider does not support returning multiple
recordsets from a single execution"
If we take the do-while loop out, we get a message box
saying:
Recordset 1:
Message: text message 1
No recordset returned
Recordset is nothing
We did add the following Dim's:
Dim SqlScript as string
dim Myrecordset as new adodb.recordset
dim recordsetnumber as long
dim sqlerror as error
dim message as string
>--Original Message--
>It looks like you're executing a NextRecordset during
your Errors collection
>iteration. I suggest you complete the iteration before
NextRecordset since
>multiple messages can be returned along with a recordset.
>Below is a VBScript example that shows one method to
process multiple
>recordsets with messages. In VB, another method is to
handle the ADO
>Connection InfoMessage event and process the messages in
your event handler.
>SqlScript = _
> "PRINT 'test message 1'" & vbCrLf & _
> "PRINT 'test message 2'" & vbCrLf & _
> "SELECT 3" & vbCrLf & _
> "PRINT 'test message 4'" & vbCrLf & _
> "SELECT 5" & vbCrLf & _
> "PRINT 'test message 6'" & vbCrLf
>Set MyRecordset = MyConnection.Execute(SqlScript)
>Message = ""
>Do While Not MyRecordset Is Nothing
> RecordsetNumber = RecordsetNumber + 1
> Message = Message & "Recordset " & _
> RecordsetNumber & ":" & VbCrLf
> If MyConnection.Errors.Count > 0 Then
> For Each SqlError In MyConnection.Errors
> Message = Message & vbTab & "Message: " & _
> SqlError.Description & vbCrLf
> Next
> Else
> Message = Message & vbTab & _
> "No messages." & vbCrLf
> End If
> If MyRecordset.State = adStateOpen Then
> Message = Message & vbTab & _
> "Rowset returned." & vbCrLf
> Else
> Message = Message & vbTab & _
> "No rowset returned." & vbCrLf
> End If
> Message = Message & vbCrLf
> Set MyRecordset = MyRecordset.NextRecordset
>Loop
>Message = Message & "Recordset is Nothing."
>MyConnection.Close
>MsgBox Message
>
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>
>"Mike B" <BGates@.Microsoft.com> wrote in message
>news:034801c3c671$449addf0$a101280a@.phx.gbl...
>> In Visual Basic using ADO, I am trying to get print
>> statements from SQL into my VB project. How does query
>> analyzer get the print statements from the server? I am
>> able to display the first TWO print statements using
the
>> [recordset].NextRecordset command, but I get an error
if
>> I try to go past the second recordset. Please help if
>> you can.
>> [CODE]
>> Dim objerr As ADODB.Error
>> On Error GoTo err_check
>> Do
>> For Each objerr In gcn.Errors
>> GetSQLPrints = GetSQLPrints & vbCrLf &
objerr.Description
>> rs.NextRecordset
>> Next
>> Loop
>> [/CODE]
>> Only Prints two... I don't know why. Please help.
>
>.
>|||It looks like there are some differences in behavior between VB and
VBScript. On my system, the VB code below uses Recordset.Open instead of
Connection.Execute and returns the same result as the original VBScript I
posted.
Dim SqlScript As String
Dim MyConnection As New ADODB.Connection
Dim MyRecordset As New ADODB.Recordset
Dim recordsetnumber As Long
Dim sqlerror As Error
Dim message As String
Dim ConnectionString As String
Dim lastError As Integer
ConnectionString = _
"Provider=SQLOLEDB" & _
";Data Source=MyServer" & _
";Integrated Security=SSPI"
MyConnection.Open ConnectionString
SqlScript = _
"SET NOCOUNT ON" & vbCrLf & _
"PRINT 'test message 1'" & vbCrLf & _
"PRINT 'test message 2'" & vbCrLf & _
"SELECT 3" & vbCrLf & _
"PRINT 'test message 4'" & vbCrLf & _
"SELECT 5" & vbCrLf & _
"PRINT 'test message 6'" & vbCrLf
MyRecordset.Open SqlScript, MyConnection
message = ""
Do While Not MyRecordset.ActiveCommand Is Nothing
recordsetnumber = recordsetnumber + 1
message = message & "Recordset " & _
recordsetnumber & ":" & vbCrLf
If MyConnection.Errors.Count > 0 Then
For Each sqlerror In MyConnection.Errors
message = message & vbTab & "Message: " & _
sqlerror.Description & vbCrLf
Next
Else
message = message & vbTab & _
"No messages." & vbCrLf
End If
If MyRecordset.State = adStateOpen Then
message = message & vbTab & _
"Rowset returned." & vbCrLf
Else
message = message & vbTab & _
"No rowset returned." & vbCrLf
End If
message = message & vbCrLf
On Error Resume Next
Set MyRecordset = MyRecordset.NextRecordset
Loop
message = message & "Recordset is Nothing."
MyConnection.Close
MsgBox message
Hope this helps.
Dan Guzman
SQL Server MVP
"Mike B/Steve Z" <szlamany@.antarescomputing.com> wrote in message
news:10e801c3c70e$22406160$a301280a@.phx.gbl...
> For our connection, we are using SQLOLEDB...
> When we run you code example, getting an error saying:
> "Current Provider does not support returning multiple
> recordsets from a single execution"
> If we take the do-while loop out, we get a message box
> saying:
> Recordset 1:
> Message: text message 1
> No recordset returned
> Recordset is nothing
> We did add the following Dim's:
> Dim SqlScript as string
> dim Myrecordset as new adodb.recordset
> dim recordsetnumber as long
> dim sqlerror as error
> dim message as string
>
> >--Original Message--
> >It looks like you're executing a NextRecordset during
> your Errors collection
> >iteration. I suggest you complete the iteration before
> NextRecordset since
> >multiple messages can be returned along with a recordset.
> >
> >Below is a VBScript example that shows one method to
> process multiple
> >recordsets with messages. In VB, another method is to
> handle the ADO
> >Connection InfoMessage event and process the messages in
> your event handler.
> >
> >SqlScript = _
> > "PRINT 'test message 1'" & vbCrLf & _
> > "PRINT 'test message 2'" & vbCrLf & _
> > "SELECT 3" & vbCrLf & _
> > "PRINT 'test message 4'" & vbCrLf & _
> > "SELECT 5" & vbCrLf & _
> > "PRINT 'test message 6'" & vbCrLf
> >
> >Set MyRecordset = MyConnection.Execute(SqlScript)
> >
> >Message = ""
> >Do While Not MyRecordset Is Nothing
> > RecordsetNumber = RecordsetNumber + 1
> > Message = Message & "Recordset " & _
> > RecordsetNumber & ":" & VbCrLf
> > If MyConnection.Errors.Count > 0 Then
> > For Each SqlError In MyConnection.Errors
> > Message = Message & vbTab & "Message: " & _
> > SqlError.Description & vbCrLf
> > Next
> > Else
> > Message = Message & vbTab & _
> > "No messages." & vbCrLf
> > End If
> > If MyRecordset.State = adStateOpen Then
> > Message = Message & vbTab & _
> > "Rowset returned." & vbCrLf
> > Else
> > Message = Message & vbTab & _
> > "No rowset returned." & vbCrLf
> > End If
> > Message = Message & vbCrLf
> > Set MyRecordset = MyRecordset.NextRecordset
> >Loop
> >Message = Message & "Recordset is Nothing."
> >MyConnection.Close
> >MsgBox Message
> >
> >
> >--
> >Hope this helps.
> >
> >Dan Guzman
> >SQL Server MVP
> >
> >
> >"Mike B" <BGates@.Microsoft.com> wrote in message
> >news:034801c3c671$449addf0$a101280a@.phx.gbl...
> >> In Visual Basic using ADO, I am trying to get print
> >> statements from SQL into my VB project. How does query
> >> analyzer get the print statements from the server? I am
> >> able to display the first TWO print statements using
> the
> >> [recordset].NextRecordset command, but I get an error
> if
> >> I try to go past the second recordset. Please help if
> >> you can.
> >>
> >> [CODE]
> >> Dim objerr As ADODB.Error
> >> On Error GoTo err_check
> >> Do
> >> For Each objerr In gcn.Errors
> >> GetSQLPrints = GetSQLPrints & vbCrLf &
> >>
> objerr.Description
> >> rs.NextRecordset
> >> Next
> >> Loop
> >> [/CODE]
> >> Only Prints two... I don't know why. Please help.
> >
> >
> >.
> >|||Thank you - your example worked great in VB as well.
Not sure where our problem was - went in circles for a
while...
>--Original Message--
>It looks like there are some differences in behavior
between VB and
>VBScript. On my system, the VB code below uses
Recordset.Open instead of
>Connection.Execute and returns the same result as the
original VBScript I
>posted.
>Dim SqlScript As String
>Dim MyConnection As New ADODB.Connection
>Dim MyRecordset As New ADODB.Recordset
>Dim recordsetnumber As Long
>Dim sqlerror As Error
>Dim message As String
>Dim ConnectionString As String
>Dim lastError As Integer
>ConnectionString = _
> "Provider=SQLOLEDB" & _
> ";Data Source=MyServer" & _
> ";Integrated Security=SSPI"
>MyConnection.Open ConnectionString
>SqlScript = _
> "SET NOCOUNT ON" & vbCrLf & _
> "PRINT 'test message 1'" & vbCrLf & _
> "PRINT 'test message 2'" & vbCrLf & _
> "SELECT 3" & vbCrLf & _
> "PRINT 'test message 4'" & vbCrLf & _
> "SELECT 5" & vbCrLf & _
> "PRINT 'test message 6'" & vbCrLf
>MyRecordset.Open SqlScript, MyConnection
>message = ""
>Do While Not MyRecordset.ActiveCommand Is Nothing
> recordsetnumber = recordsetnumber + 1
> message = message & "Recordset " & _
> recordsetnumber & ":" & vbCrLf
> If MyConnection.Errors.Count > 0 Then
> For Each sqlerror In MyConnection.Errors
> message = message & vbTab & "Message: " & _
> sqlerror.Description & vbCrLf
> Next
> Else
> message = message & vbTab & _
> "No messages." & vbCrLf
> End If
> If MyRecordset.State = adStateOpen Then
> message = message & vbTab & _
> "Rowset returned." & vbCrLf
> Else
> message = message & vbTab & _
> "No rowset returned." & vbCrLf
> End If
> message = message & vbCrLf
> On Error Resume Next
> Set MyRecordset = MyRecordset.NextRecordset
>Loop
>message = message & "Recordset is Nothing."
>MyConnection.Close
>MsgBox message
>
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>
>"Mike B/Steve Z" <szlamany@.antarescomputing.com> wrote
in message
>news:10e801c3c70e$22406160$a301280a@.phx.gbl...
>> For our connection, we are using SQLOLEDB...
>> When we run you code example, getting an error saying:
>> "Current Provider does not support returning multiple
>> recordsets from a single execution"
>> If we take the do-while loop out, we get a message box
>> saying:
>> Recordset 1:
>> Message: text message 1
>> No recordset returned
>> Recordset is nothing
>> We did add the following Dim's:
>> Dim SqlScript as string
>> dim Myrecordset as new adodb.recordset
>> dim recordsetnumber as long
>> dim sqlerror as error
>> dim message as string
>>
>> >--Original Message--
>> >It looks like you're executing a NextRecordset during
>> your Errors collection
>> >iteration. I suggest you complete the iteration
before
>> NextRecordset since
>> >multiple messages can be returned along with a
recordset.
>> >
>> >Below is a VBScript example that shows one method to
>> process multiple
>> >recordsets with messages. In VB, another method is to
>> handle the ADO
>> >Connection InfoMessage event and process the messages
in
>> your event handler.
>> >
>> >SqlScript = _
>> > "PRINT 'test message 1'" & vbCrLf & _
>> > "PRINT 'test message 2'" & vbCrLf & _
>> > "SELECT 3" & vbCrLf & _
>> > "PRINT 'test message 4'" & vbCrLf & _
>> > "SELECT 5" & vbCrLf & _
>> > "PRINT 'test message 6'" & vbCrLf
>> >
>> >Set MyRecordset = MyConnection.Execute(SqlScript)
>> >
>> >Message = ""
>> >Do While Not MyRecordset Is Nothing
>> > RecordsetNumber = RecordsetNumber + 1
>> > Message = Message & "Recordset " & _
>> > RecordsetNumber & ":" & VbCrLf
>> > If MyConnection.Errors.Count > 0 Then
>> > For Each SqlError In MyConnection.Errors
>> > Message = Message & vbTab & "Message: " &
_
>> > SqlError.Description & vbCrLf
>> > Next
>> > Else
>> > Message = Message & vbTab & _
>> > "No messages." & vbCrLf
>> > End If
>> > If MyRecordset.State = adStateOpen Then
>> > Message = Message & vbTab & _
>> > "Rowset returned." & vbCrLf
>> > Else
>> > Message = Message & vbTab & _
>> > "No rowset returned." & vbCrLf
>> > End If
>> > Message = Message & vbCrLf
>> > Set MyRecordset = MyRecordset.NextRecordset
>> >Loop
>> >Message = Message & "Recordset is Nothing."
>> >MyConnection.Close
>> >MsgBox Message
>> >
>> >
>> >--
>> >Hope this helps.
>> >
>> >Dan Guzman
>> >SQL Server MVP
>> >
>> >
>> >"Mike B" <BGates@.Microsoft.com> wrote in message
>> >news:034801c3c671$449addf0$a101280a@.phx.gbl...
>> >> In Visual Basic using ADO, I am trying to get print
>> >> statements from SQL into my VB project. How does
query
>> >> analyzer get the print statements from the server?
I am
>> >> able to display the first TWO print statements using
>> the
>> >> [recordset].NextRecordset command, but I get an
error
>> if
>> >> I try to go past the second recordset. Please help
if
>> >> you can.
>> >>
>> >> [CODE]
>> >> Dim objerr As ADODB.Error
>> >> On Error GoTo err_check
>> >> Do
>> >> For Each objerr In gcn.Errors
>> >> GetSQLPrints = GetSQLPrints & vbCrLf &
>> >>
>> objerr.Description
>> >> rs.NextRecordset
>> >> Next
>> >> Loop
>> >> [/CODE]
>> >> Only Prints two... I don't know why. Please help.
>> >
>> >
>> >.
>> >
>
>.
>

ADO Connection to MSSQL Server 2005... Need help

Hi,

at first a few things about my system:
I use Visual Studio 2005 Pro on WinXP SP2 and I have recently installed MSSQL Server 2005 Express on my system.

I want to establish a connection to the MSSQL Server from C++ (not .NET) using ADO.

For this I use the following connection String:

Open(L"Provider=SQLNCLI;Server=FREECASTLE;Integrated

Security=SSPI;DataTypeCompatibility=80;MARS

Connection=True;",L"",L"",ADODB::adConnectUnspecified);

This works. But this is not exactly that what I wanted, because here

just my Windows Authentication is used. I want to be able to pass

username and password for users that are allowed to access the SQL

Server. Here my first confusion begins: I have the option to pass the username and password into the connection string (User Id and Password) or I guess that I can pass them also as parameter 2 and parameter 3. But with trying both of these options I get always a connection error that my specified Username is not be trusted ( I don't know how the message looks in the English version, because I have the german version), but I suppose you know what I mean.

Of course I have to create such accounts in the SQL Server before trying to login with them. I guess that I made something wrong when doing this. I started the Server Manager Studio and there I navigated into the Object Explorer. In the folder Security I created a new account for testing (using SQL Server Authentication). But I cannot use that account for logging in.

I have to admit that I am very new to the SQL Server thing, so I hope someone can help me or can give me hints on what to do better. I am very thankful for every reply...That specific error message means, that you only enabled your server for WIndows authentication, if you want to use also SQL Server authentication you will have to enabled it first (using mixed Authentication). See the Screencast on my site for more information about Changing the authentication mode in SQL Server.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Hi Jens,
with your Screencast I solved my problem. Thank you very much for your help.

ADO Connection String Error for Mirrored Database

I am trying to connect to a failover partner using ADO (non .Net) and Visual C++. ADO is throwing the following exception:

Caught: Unspecified error - Invalid connection string attribute(Microsoft OLE DB Provider for SQL Server)

Connection String:
Provider=SQLOLEDB.1;Data Source=Edwardsville\SQLSERVER;Failover Partner=Mirror2\SQLSERVER;Initial Catalog=SomeCatalog;User Id=SomeId;Password=SomePassword

Any ideas?

As far as I know this is only supported in ADO.NET 2.0.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Hi, Im trying to do the same thing.

Could you get any answer to this? Its possible with ADODB ?

Thanks

ADO Connection String Error for Mirrored Database

I am trying to connect to a failover partner using ADO (non .Net) and Visual C++. ADO is throwing the following exception:

Caught: Unspecified error - Invalid connection string attribute(Microsoft OLE DB Provider for SQL Server)

Connection String:
Provider=SQLOLEDB.1;Data Source=Edwardsville\SQLSERVER;Failover Partner=Mirror2\SQLSERVER;Initial Catalog=SomeCatalog;User Id=SomeId;Password=SomePassword

Any ideas?

As far as I know this is only supported in ADO.NET 2.0.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Hi, Im trying to do the same thing.

Could you get any answer to this? Its possible with ADODB ?

Thanks