Connecting to database in vc 7
i am using the code i get from msdn
its something like as follows
_ConnectionPtr ConnectionPtr1 = NULL;
if ( FAILED ( ::CoInitialize ( NULL ))) return false;
ConnectionPtr1.CreateInstance ( __uuidof(Connection));
ConnectionPtr1 -> ConnectionString = "driver={SQL Server};server='130.1.16.199';user id='sa';password='';";
// driver={SQL Server}; server='local'; user id='sa'; password=''
ConnectionPtr1 -> Open ( "","","",adConnectUnspecified );
ConnectionPtr1 -> DefaultDatabase = " TB_DIALER";
// Display the provider
TRACE ( "\n\nConnection1 provider: %s \n\n",( LPCSTR )ConnectionPtr1 -> Provider );
but i am getting exception here
its saying that sql server not exist or access denied
my sql server is running perfect and i can access it from other vb applications
its very urgent i am actualy stucked here
can any one help me in this

