Click here to Skip to main content
16,005,290 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need some help with visual c++ and sql2000 ado connection Pin
David Crow16-Jan-07 2:48
David Crow16-Jan-07 2:48 
AnswerRe: Need some help with visual c++ and sql2000 ado connection Pin
KarstenK16-Jan-07 2:55
mveKarstenK16-Jan-07 2:55 
GeneralRe: Need some help with visual c++ and sql2000 ado connection Pin
XTr1NiTy16-Jan-07 3:04
XTr1NiTy16-Jan-07 3:04 
GeneralRe: Need some help with visual c++ and sql2000 ado connection Pin
prasad_som16-Jan-07 3:07
prasad_som16-Jan-07 3:07 
GeneralRe: Need some help with visual c++ and sql2000 ado connection Pin
XTr1NiTy16-Jan-07 3:12
XTr1NiTy16-Jan-07 3:12 
GeneralRe: Need some help with visual c++ and sql2000 ado connection Pin
KarstenK16-Jan-07 3:47
mveKarstenK16-Jan-07 3:47 
GeneralRe: Need some help with visual c++ and sql2000 ado connection Pin
David Crow16-Jan-07 6:37
David Crow16-Jan-07 6:37 
QuestionRe: Need some help with visual c++ and sql2000 ado connection Pin
XTr1NiTy16-Jan-07 3:33
XTr1NiTy16-Jan-07 3:33 
Sorry about that, i know its looong, and that happens when i include the file. If i dont include msado15.dll it doesnt give any errors, but that is with commenting out this code i got from examples (would it work for a sql 2000 database?) :
<br />
HRESULT hr;<br />
CoInitialize(NULL);<br />
try<br />
{<br />
ADODB::_ConnectionPtr connection;<br />
hr = connection.CreateInstance(__uuidof(ADODB::Connection));<br />
if(FAILED(hr))<br />
{<br />
throw __com_error(hr);<br />
}<br />
<br />
ADODB::_RecordsetPtr recordset;<br />
hr = recordset.CreateInstance(__uuidof(ADOBD::RecordSet));<br />
if(FAILED(hr))<br />
{<br />
throw _com_error(hr);<br />
}<br />
<br />
connection->CursorLocation = ADODB::adUseClient;<br />
connection->Open(L"Provider=sqloledb;Data Source=Sunserver;"L"Initial Catalog=IT_DB;User Id=testassword=test;", L,"",L"",ADODB::adConnectUnspecified);<br />
<br />
recordset->Open("SELECT * from Users",connection.GetInterfacePtr(),ADODB::adOpenForwardOnly,ADODB::adLockReadOnly, ADODB::adCmdText);<br />
<br />
<br />
while(!recordset->ADOEOF)<br />
{<br />
_variant_t var;<br />
var = recordset->Fields->GetItem(L"Username")->GetValue();<br />
std::cout << static_cast(_bstr_t(var.bstrVal)) << std::endl;<br />
recordset->MoveNext();<br />
};<br />
<br />
recordset->Close();<br />

QuestionLinker errors in vc++ Pin
siddharthsan16-Jan-07 1:25
siddharthsan16-Jan-07 1:25 
AnswerRe: Linker errors in vc++ Pin
Rage16-Jan-07 1:34
professionalRage16-Jan-07 1:34 
AnswerRe: Linker errors in vc++ Pin
MuraliKrishnaP16-Jan-07 1:36
MuraliKrishnaP16-Jan-07 1:36 
GeneralRe: Linker errors in vc++ Pin
siddharthsan16-Jan-07 1:54
siddharthsan16-Jan-07 1:54 
AnswerRe: Linker errors in vc++ Pin
Roger Stoltz16-Jan-07 2:12
Roger Stoltz16-Jan-07 2:12 
QuestionRe: Linker errors in vc++ Pin
David Crow16-Jan-07 2:51
David Crow16-Jan-07 2:51 
AnswerRe: Linker errors in vc++ Pin
KarstenK16-Jan-07 2:52
mveKarstenK16-Jan-07 2:52 
AnswerRe: Linker errors in vc++ Pin
chacoo26-Feb-07 22:13
chacoo26-Feb-07 22:13 
Questionunicode Pin
manu_220516-Jan-07 1:24
manu_220516-Jan-07 1:24 
AnswerRe: unicode Pin
Rage16-Jan-07 1:25
professionalRage16-Jan-07 1:25 
GeneralRe: unicode Pin
manu_220516-Jan-07 1:33
manu_220516-Jan-07 1:33 
GeneralRe: unicode Pin
Rajesh R Subramanian16-Jan-07 1:42
professionalRajesh R Subramanian16-Jan-07 1:42 
GeneralRe: unicode Pin
manu_220516-Jan-07 1:50
manu_220516-Jan-07 1:50 
QuestionRe: unicode Pin
David Crow16-Jan-07 2:58
David Crow16-Jan-07 2:58 
Questioni Pin
manu_220516-Jan-07 1:20
manu_220516-Jan-07 1:20 
AnswerRe: i Pin
Hamid_RT16-Jan-07 1:24
Hamid_RT16-Jan-07 1:24 
QuestionLNK4006 warning Pin
shivapriyak16-Jan-07 0:52
shivapriyak16-Jan-07 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.