From: Tim B. <us...@ms...> - 2004-11-27 17:47:10
|
Carlos, =20 Sorry, still new to source forge and didn't realize you had responded to = the archive. I have an account now. Let me start by saying I hope I = didn't mis-represent anything in my earlier post. I 'assumed' that the = Firebird API supported such as thing a db-less connection because one of the test cases in IBPP (Test 2) seemed to support such a thing. While I = consider myself a pretty proficient C# developer my C and C++ aren't so great. I read through the code for the IBPP service object and it also seems to support such a connection via ISC....Here's the code from Test 2 of = IBPP.... ---- [Tests.cpp] void Test::Test2(void) =20 { ... IBPP::Service svc =3D IBPP::ServiceFactory(ServerName, UserName, Password); svc->Connect(); ... } .. And here's the implementation of the service factory [Service.cpp] void ServiceImpl::Connect(void) { if (gds.Call()->mGDSVersion < 60) throw ExceptionImpl("Service", "Requires the version 6 of GDS32.DLL"); if (mHandle !=3D 0) throw ExceptionImpl("Service::Connect", "Service is already connected."); if (mUserName.empty()) throw ExceptionImpl("Service::Connect", "Unspecified user name."); if (mUserPassword.empty()) throw ExceptionImpl("Service::Connect", "Unspecified user password."); // Attach to the Service Manager IBS status; SPB spb; std::string connect; // Build a SPB based on the properties spb.Insert(isc_spb_version); spb.Insert(isc_spb_current_version); spb.InsertString(isc_spb_user_name, 1, mUserName.c_str()); spb.InsertString(isc_spb_password, 1, mUserPassword.c_str()); if (! mServerName.empty()) { connect =3D mServerName; connect +=3D ":"; } connect +=3D "service_mgr"; (*gds.Call()->m_service_attach)(status.Self(), (short)connect.size(), (char*)connect.c_str(), &mHandle, spb.Size(), spb.Self()); if (status.Errors()) { mHandle =3D 0; // Should be, but better be sure... throw ExceptionImpl(status, "Service::Connect", "isc_service_attach failed"); } } ------------- It looks to me that the call to gds.Call()->m_service_attach is bona = fide call to the API (a stub for isc_service_attach) and not some sort of function that doesn't do anything but reserve an IBPP-only connection object. Am I wrong? Is it even possible to do what I want? Which, = again, is to connect without specifying a db and then query the system tables = or Firebird service, based on user privileges, for a list of attached db's? I've been reviewing the various service functions available through ISQL = or one of the other command line tools? I am a complete newbie to Firebird and still trying to learn the API so = I apologize for asking a potentially stupid question. Is there a good API reference I could use to not waste people's time with questions like = these? I have the "Firebird Book" but it doesn't go into to much detail on the API....and otherwise I've been stuck to trying to read other people's = code and make my own inferences..... Thanks tim =20 =20 Tim Brooks 206.390.2122 us...@ms... =20 Man's best friend, outside of a dog, is a good book. Inside of a dog, = it's too dark to read. -- Groucho Marx =20 --------------- Hello: > >My apologies for writing directly. =20 > No problem. >The news archive seems to be closed. =20 > Are you subscribed to the devel list ?? >Anyway, I was wondering why the .Net provider doesn"t=20 >support an connection string without providing an explicit=20 >database reference. =20 > Well at this moment thew only place where you can connect without give a = database is in the services API. >The API and IPBB both support creating=20 >a connection object without specifying a database. =20 > Could you put a sample ?? --=20 Best regards Carlos Guzm=E1n =C1lvarez =20 |