Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Monday, March 19, 2012

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.
|||Did anyone figure out how to resolve this? I'm having the same problem....
|||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.
|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.|||Did anyone figure out how to resolve this? I'm having the same problem.... |||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.
|||Did anyone figure out how to resolve this? I'm having the same problem....
|||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.
|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.|||Did anyone figure out how to resolve this? I'm having the same problem.... |||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.|||Did anyone figure out how to resolve this? I'm having the same problem.... |||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

Advanced SQL Generation Options in VS2005

Hi There

im not sure if im in the right place but i was wondering why the above option is greyed out when creating a new sql datasource. This occurs even when i select all fields within the table (including primary key fields)

Thanks
Todd

I'm not exactly sure which forum would be best for you - you could try this one ...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=7&SiteID=1

Donald

|||Were you able to find an answer to this? I am having the same issue.|||not yet
Tongue Tied|||Ive had another crack at this & worked it out.

For me i didnt have the primary key set in the sql database.

Added that & its Happy Days

Hope this helps.

ToddBig Smile|||I have the same problem. I set the primary key in the table I'm trying to access to ArticlesID with the value of int, I select all the proper settings, but the Advanced SQL Options is still greyed out. I cannot seem to get this to work.|||Did anyone figure out how to resolve this? I'm having the same problem.... |||I found that you have to make absolutely certain that you set the primary key correctly by right clicking on the column in the database, then you have to make sure you don't click the "show unique records" checkbox.|||One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.|||

limonada wrote:

One thing I noticed is that the option is grayed out if the table used in the select statement has no primary key, which makes sense, since UPDATE and DELETE operations on a table without a primary key are very specific to the logic behing the table and cannot be generated automatically.

This is what I found as well and it's worth mentioning again as I spent ages before realising what I was doing wrong. It is not enough to just have a primary key in the table, the primary key column MUST be part of the data you are retrieving/selecting otherwise the "Generate INSERT, UPDATE and DELETE statements" option will be greyed out in the advanced menu.

|||

This happened to me too, and I realized that setting the Column Property "Identity Specification" to Yes for the intended Primary Key field will not alone make it as a Primary Key. You have to right click on the Column and select "Set Primary Key" to enable the Advanced SQL Generations Options.

Hope this information help with any newbie like me who made the same mistake. :-)

|||Pls set a primary key to a unique field,it will work.

Sunday, February 19, 2012

ADO Interop Using MDAC 2.8 On Vista

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

Hi Bruce,

Did you ever get this problem solved? I'm getting a similar problem on a Windows 2000 machine. Whenever we try to do ADOX Interop we get a "Library not registered" exception. We can't replicate this behaviour as it's on a client machine using Terminal Services.

Regards,

Brent

|||

Hi,

Just a note to all, registering the msadox.dll could solve the "Library not registered" problem when trying to use ADOX Interop.

regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll"

Hope this helps someone.

- Brent

|||

I have found that registering msadox does not help in this case because the msadox version that lives in vista is 6.0, whereas the latest version I have been able to find is 2.8. Does anyone know where the 6.0 version comes from?

Jeff

|||

I have found that MDAC has been replaced by WDAC as this article describes: http://msdn2.microsoft.com/en-us/library/ms692897.aspx That is where the 6.0 version comes from. Now I just need to know how to get 2.8 on the system.

|||

Take a look at this link that talks about Redistributing MDAC 28 : http://msdn2.microsoft.com/en-us/library/ms693148.aspx

Also can you add "Microsoft ActiveX Data Objects 2.8 Library", "Microsoft ADO Ext 6.0 for DDL and Security" to your project references and see if it helps?

msado28.tlb should be there in \Program Files\Common Files\System\ado location

Hope this helps

|||

Okay, so have any of the above lead to a solution? My problem is that I have this new development laptop with Vista. But my code needs to run on Server 2000/2003 and XP. So how do I get my project to build with a reference to ADOX 2.8 on Vista? Or, if I replace my ADOX 2.8 reference with one to ADOX 6.0, will I be able to install my project on an XP machine?

I'm posting this because I'm not sure if any of the above have actually fixed the problem. Please correct me if I'm wrong.

Thanks.

Kenneth.

|||Could you try having your msadox.dll of the lowest version you want create .net metadata dll like:

tlbimp msadox.dll /out:ADOX28.dll

Then put this ADOX28.dll file on your development machine and add reference to it.|||

Okay, so that seems to get me to be able to build if I do this:

using ADOX = ADOX28;

But I don't think that'll help me deploy to XP right?

So I did this on an XP development machine with ADOX installed then moved the resultant output to my Vista development machine:

tlbimp ADOX.dll /namespace:ADOX /asmversion:2.8 /out:ADOX28.dll

So now I can simply do:

using ADOX;

Thanks.

Kenneth.

ADO Interop Using MDAC 2.8 On Vista

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

Hi Bruce,

Did you ever get this problem solved? I'm getting a similar problem on a Windows 2000 machine. Whenever we try to do ADOX Interop we get a "Library not registered" exception. We can't replicate this behaviour as it's on a client machine using Terminal Services.

Regards,

Brent

|||

Hi,

Just a note to all, registering the msadox.dll could solve the "Library not registered" problem when trying to use ADOX Interop.

regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll"

Hope this helps someone.

- Brent

|||

I have found that registering msadox does not help in this case because the msadox version that lives in vista is 6.0, whereas the latest version I have been able to find is 2.8. Does anyone know where the 6.0 version comes from?

Jeff

|||

I have found that MDAC has been replaced by WDAC as this article describes: http://msdn2.microsoft.com/en-us/library/ms692897.aspx That is where the 6.0 version comes from. Now I just need to know how to get 2.8 on the system.

|||

Take a look at this link that talks about Redistributing MDAC 28 : http://msdn2.microsoft.com/en-us/library/ms693148.aspx

Also can you add "Microsoft ActiveX Data Objects 2.8 Library", "Microsoft ADO Ext 6.0 for DDL and Security" to your project references and see if it helps?

msado28.tlb should be there in \Program Files\Common Files\System\ado location

Hope this helps

|||

Okay, so have any of the above lead to a solution? My problem is that I have this new development laptop with Vista. But my code needs to run on Server 2000/2003 and XP. So how do I get my project to build with a reference to ADOX 2.8 on Vista? Or, if I replace my ADOX 2.8 reference with one to ADOX 6.0, will I be able to install my project on an XP machine?

I'm posting this because I'm not sure if any of the above have actually fixed the problem. Please correct me if I'm wrong.

Thanks.

Kenneth.

|||Could you try having your msadox.dll of the lowest version you want create .net metadata dll like:

tlbimp msadox.dll /out:ADOX28.dll

Then put this ADOX28.dll file on your development machine and add reference to it.|||

Okay, so that seems to get me to be able to build if I do this:

using ADOX = ADOX28;

But I don't think that'll help me deploy to XP right?

So I did this on an XP development machine with ADOX installed then moved the resultant output to my Vista development machine:

tlbimp ADOX.dll /namespace:ADOX /asmversion:2.8 /out:ADOX28.dll

So now I can simply do:

using ADOX;

Thanks.

Kenneth.

ADO Interop Using MDAC 2.8 On Vista

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

Hi Bruce,

Did you ever get this problem solved? I'm getting a similar problem on a Windows 2000 machine. Whenever we try to do ADOX Interop we get a "Library not registered" exception. We can't replicate this behaviour as it's on a client machine using Terminal Services.

Regards,

Brent

|||

Hi,

Just a note to all, registering the msadox.dll could solve the "Library not registered" problem when trying to use ADOX Interop.

regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll"

Hope this helps someone.

- Brent

|||

I have found that registering msadox does not help in this case because the msadox version that lives in vista is 6.0, whereas the latest version I have been able to find is 2.8. Does anyone know where the 6.0 version comes from?

Jeff

|||

I have found that MDAC has been replaced by WDAC as this article describes: http://msdn2.microsoft.com/en-us/library/ms692897.aspx That is where the 6.0 version comes from. Now I just need to know how to get 2.8 on the system.

|||

Take a look at this link that talks about Redistributing MDAC 28 : http://msdn2.microsoft.com/en-us/library/ms693148.aspx

Also can you add "Microsoft ActiveX Data Objects 2.8 Library", "Microsoft ADO Ext 6.0 for DDL and Security" to your project references and see if it helps?

msado28.tlb should be there in \Program Files\Common Files\System\ado location

Hope this helps

|||

Okay, so have any of the above lead to a solution? My problem is that I have this new development laptop with Vista. But my code needs to run on Server 2000/2003 and XP. So how do I get my project to build with a reference to ADOX 2.8 on Vista? Or, if I replace my ADOX 2.8 reference with one to ADOX 6.0, will I be able to install my project on an XP machine?

I'm posting this because I'm not sure if any of the above have actually fixed the problem. Please correct me if I'm wrong.

Thanks.

Kenneth.

|||Could you try having your msadox.dll of the lowest version you want create .net metadata dll like:

tlbimp msadox.dll /out:ADOX28.dll

Then put this ADOX28.dll file on your development machine and add reference to it.|||

Okay, so that seems to get me to be able to build if I do this:

using ADOX = ADOX28;

But I don't think that'll help me deploy to XP right?

So I did this on an XP development machine with ADOX installed then moved the resultant output to my Vista development machine:

tlbimp ADOX.dll /namespace:ADOX /asmversion:2.8 /out:ADOX28.dll

So now I can simply do:

using ADOX;

Thanks.

Kenneth.

ADO Interop Using MDAC 2.8 On Vista

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

Hi Bruce,

Did you ever get this problem solved? I'm getting a similar problem on a Windows 2000 machine. Whenever we try to do ADOX Interop we get a "Library not registered" exception. We can't replicate this behaviour as it's on a client machine using Terminal Services.

Regards,

Brent

|||

Hi,

Just a note to all, registering the msadox.dll could solve the "Library not registered" problem when trying to use ADOX Interop.

regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll"

Hope this helps someone.

- Brent

|||

I have found that registering msadox does not help in this case because the msadox version that lives in vista is 6.0, whereas the latest version I have been able to find is 2.8. Does anyone know where the 6.0 version comes from?

Jeff

|||

I have found that MDAC has been replaced by WDAC as this article describes: http://msdn2.microsoft.com/en-us/library/ms692897.aspx That is where the 6.0 version comes from. Now I just need to know how to get 2.8 on the system.

|||

Take a look at this link that talks about Redistributing MDAC 28 : http://msdn2.microsoft.com/en-us/library/ms693148.aspx

Also can you add "Microsoft ActiveX Data Objects 2.8 Library", "Microsoft ADO Ext 6.0 for DDL and Security" to your project references and see if it helps?

msado28.tlb should be there in \Program Files\Common Files\System\ado location

Hope this helps

|||

Okay, so have any of the above lead to a solution? My problem is that I have this new development laptop with Vista. But my code needs to run on Server 2000/2003 and XP. So how do I get my project to build with a reference to ADOX 2.8 on Vista? Or, if I replace my ADOX 2.8 reference with one to ADOX 6.0, will I be able to install my project on an XP machine?

I'm posting this because I'm not sure if any of the above have actually fixed the problem. Please correct me if I'm wrong.

Thanks.

Kenneth.

|||Could you try having your msadox.dll of the lowest version you want create .net metadata dll like:

tlbimp msadox.dll /out:ADOX28.dll

Then put this ADOX28.dll file on your development machine and add reference to it.|||

Okay, so that seems to get me to be able to build if I do this:

using ADOX = ADOX28;

But I don't think that'll help me deploy to XP right?

So I did this on an XP development machine with ADOX installed then moved the resultant output to my Vista development machine:

tlbimp ADOX.dll /namespace:ADOX /asmversion:2.8 /out:ADOX28.dll

So now I can simply do:

using ADOX;

Thanks.

Kenneth.

ADO Interop Access under Vista

I am trying to load a

project under VS2005 under Windows Vista that references an ADOX

wrapper that is looking for version 2.8.0.0. The reference fails

because the library is not registered.

I thought maybe

installing MDAC 2.8 would solve my problems, but when I run the

installer for that, it briefly puts up a dialog that it is extracting

files, then it disappears.

Anyone have any ideas?

--Bruce
Hi,

I would suggest that you look under "Deployment Projects" on MSDN

Here you can choose "Prerequisites" for you application which get installed through an installer.

I had a quick look but as I dont know what language you are using I can only suggest the above.

Regards,
Pace
|||This is not a deployment issue, this is a build issue.

This is an existing C# solution that I am trying to build under VS2005 under Windows Vista. One of the projects references a .NET wrapper around ADOX. When the project loads in VS2005, I get the warning sign over the reference indicating it can't resolve the reference, and I get 'type not registered' errors.

This is a fresh install of Vista RTM and Visual Studio. The project existed before and builds fine under Windows XP.

The properties on the reference refer to v2.8.0.0. Perhaps Vista doesn't have/support this version of MDAC?

When I try to install v2.8 of MDAC under Vista, the installer starts but then abruptly aborts.|||

I actually came across the exact same problem last night with a project that I started in XP and then tried to open in Vista.

I suspect that you are right -- ADOX exists on Vista, but it is version 6.0.6000.16386. I would try removing the reference to ADOX and then adding it back in again with the 6.00 version and see if that solves your problem.

Also, you MIGHT be able to take the 2.8 version from XP -- C:\Program Files\Common Files\System\ado [I believe it is msadox.dll] and copy it to Vista and register it? I haven't tried that so I don't know if it will/won't work.

I'm going to do some additional work on this tonight to see if I can come up with a solution; if you find something, please post!

Thursday, February 16, 2012

ADO erroring under VS2005 that don't occur under VS2003

I've tried posting this question to the C++ forum - but no solutions there...

The following code fragment works when compiled in VS2003 on both Windows XP Pro (32-bit) and WindowsXP Pro x64.

However, when compiled under VS2005, the call to 'pMyRecordsetPtr->RecordCount' fails on both 32bit and 64bit WindowsXP.

I have tried #import'ing msado20.tlb and msado27.tlb.

Has anybody had any similar experience?

HRESULT hr = ::CoInitialize(NULL);

if (FAILED(hr))

{

return false;

}

_ConnectionPtr pConnection;

hr = pConnection.CreateInstance(__uuidof(Connection));

if (FAILED(hr))

{

return false;

}

try

{

//

_bstr_t strConnectionString = "Provider=sqloledb;Server=server1;Database=db1" ;

pConnection->CursorLocation = adUseClient ;

pConnection->Open(strConnectionString,

_T("user"), _T("pwd"), -1);

_CommandPtr pCommand(__uuidof(Command));

pCommand->ActiveConnection = pConnection;

pCommand->CommandText = "MyStoreProcedure";

pCommand->CommandType = adCmdStoredProc;

_RecordsetPtr pRecordSet = pCommand->Execute( 0, 0, 0 ) ;

// This fails
long lNumRecs = pRecordSet->RecordCount ;

pRecordSet->Close();

pConnection->Close();

::CoUninitialize();

}

catch (_com_error &e)

{

::CoUninitialize();

// ...

}

Dear Chappers, I get an error also, but no solution, sorry

Ado.cpp

h:\src\alarmlogger_vc2005\alarmview\debugobj\msado15.tli(111) : error C2065: '_result' : undeclared identifier

ADO erroring under VS2005 that don't occur under VS2003

I've tried posting this question to the C++ forum - but no solutions there...

The following code fragment works when compiled in VS2003 on both Windows XP Pro (32-bit) and WindowsXP Pro x64.

However, when compiled under VS2005, the call to 'pMyRecordsetPtr->RecordCount' fails on both 32bit and 64bit WindowsXP.

I have tried #import'ing msado20.tlb and msado27.tlb.

Has anybody had any similar experience?

HRESULT hr = ::CoInitialize(NULL);

if (FAILED(hr))

{

return false;

}

_ConnectionPtr pConnection;

hr = pConnection.CreateInstance(__uuidof(Connection));

if (FAILED(hr))

{

return false;

}

try

{

//

_bstr_t strConnectionString = "Provider=sqloledb;Server=server1;Database=db1" ;

pConnection->CursorLocation = adUseClient ;

pConnection->Open(strConnectionString,

_T("user"), _T("pwd"), -1);

_CommandPtr pCommand(__uuidof(Command));

pCommand->ActiveConnection = pConnection;

pCommand->CommandText = "MyStoreProcedure";

pCommand->CommandType = adCmdStoredProc;

_RecordsetPtr pRecordSet = pCommand->Execute( 0, 0, 0 ) ;

// This fails
long lNumRecs = pRecordSet->RecordCount ;

pRecordSet->Close();

pConnection->Close();

::CoUninitialize();

}

catch (_com_error &e)

{

::CoUninitialize();

// ...

}

Dear Chappers, I get an error also, but no solution, sorry

Ado.cpp

h:\src\alarmlogger_vc2005\alarmview\debugobj\msado15.tli(111) : error C2065: '_result' : undeclared identifier