nsCAutoString path("abdirectory: path += dbName; rv = rdfService->GetResource(path, getter_AddRefs(resource));
rv = rdfService->GetResource(dbUri, getter_AddRefs(resource));
static nsresult OpenAddressBook(const char * dbName, nsIAddrDatabase** aDatabase, nsIAbDirectory** aDirectory){	if (!aDatabase || !aDirectory)		return NS_ERROR_NULL_POINTER;	nsresult rv = NS_OK;	nsFileSpec* dbPath = nsnull;	NS_WITH_SERVICE(nsIAddrBookSession, abSession, kAddrBookSessionCID, &rv); 	if(NS_SUCCEEDED(rv))		abSession->GetUserProfileDirectory(&dbPath);		if (dbPath)	{		(*dbPath) += dbName;		NS_WITH_SERVICE(nsIAddrDatabase, addrDBFactory, kAddressBookDBCID, &rv);		if (NS_SUCCEEDED(rv) && addrDBFactory)			rv = addrDBFactory->Open(dbPath, PR_TRUE, aDatabase, PR_TRUE);	}	NS_WITH_SERVICE(nsIRDFService, rdfService, kRDFServiceCID, &rv);	if (NS_FAILED(rv)) 		return rv;	nsCOMPtr <nsIRDFResource> resource;	nsCAutoString path("abdirectory://");	path += dbName;	rv = rdfService->GetResource(path, getter_AddRefs(resource));	if (NS_FAILED(rv)) 		return rv;	// query interface 	rv = resource->QueryInterface(nsIAbDirectory::GetIID(), (void **)aDirectory);	return rv;}