Data Source="." - was a solution ...
But I got a big old Visual Studio 6.0 Project creating test data I want to feed into a SQL 2005 express database.
I read that it should be possible to connect a C++ 6.0 project via SQLs native client to SQL 2005 express server and tried for hours and hours but never succeeded with my following :
VC++ 6 code
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" rename("EOF", "EndOfFile")
int main(int argc, char* argv[]) {
if(FAILED(::CoInitialize(NULL)))
return 1;
ADODB::_ConnectionPtr m_Cnn=NULL;
HRESULT hr;
char* CnnStr = "Provider=SQLNCLI.1; _
Data Source=.\\SQLEXPRESS; _
AttachDbFilename=C:\\test\\DB.mdf; _
Integrated Security=False; _
Connect Timeout=30; _
User Instance=True";
hr = m_Cnn.CreateInstance(__uuidof( ADODB::Connection ) );
m_Cnn->Open(CnnStr, "admin", "admin", NULL);
//--here I got alwaysan error during debugging
m_Cnn->Close();
m_Cnn=NULL;
::CoUninitialize();
return 0;
}
One Problem could be that SQL Server 2005 express got Windows Authentication and I dont know what User/Password to use in the ConnectionString. What is the exact connection string that should be used?
Another problem seems that my SQL Servere 2005 express doesnt accept SQL Authentication even though I gave myself any possible permission in SQLserverManagementStudio . (Do I have to change my XPpro folder options to uncheck 'simple file sharing'?)
I just read the step by step guide "Using SQL Express from Visual Basic 6" (http://msdn.microsoft.com/vbrun/vbfusion/usingsqlexpress/) for Visual Basic 6 and Im looking for a similar guide for Visual Cplus 6.
Would be nice if somebody could give some helping hints.

