|
|
Hello everyone:
i write a win32 c++ program,then i add ATL OLE DB consumer in my project.now i need the function that when the SQL database's data change,my main program's window can refresh view.so i refer to msnd:
==========================================================================
Visual C++
Receiving Notifications
OLE DB provides interfaces for receiving notifications when events occur. These are described in OLE DB Object Notifications in the OLE DB Programmer's Reference. Setup of these events uses the standard COM connection-point mechanism. For example, an ATL object that wants to retrieve events through IRowsetNotify implements the IRowsetNotify interface by adding IRowsetNotify to the class-derived list and exposing it through a COM_INTERFACE_ENTRY macro.
IRowsetNotify has three methods, which can be called at various times. If you want to respond to only one of these methods, you can use the IRowsetNotifyImpl class, which returns E_NOTIMPL for the methods you are not interested in.
When you create the rowset, you must tell the provider that you want the returned rowset object to support IConnectionPointContainer, which is needed to set up the notification.
The following code shows how to open the rowset from an ATL object and use the AtlAdvise function to set up the notification sink. AtlAdvise returns a cookie that is used when you call AtlUnadvise.
---------------------------------------------------
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_IConnectionPointContainer, true);
product.Open(session, _T("Products"), &propset);
AtlAdvise(product.m_spRowset, GetUnknown(), IID_IRowsetNotify, &m_dwCookie);
============================================================================
the code is so little that i don't know how to implement in my code,did anyone can help me?
thanks a lot!
|
|
|
|
|
Hi All,
How can i make my database more and more secure so that unautorised user cannot have access to my database by Enterprises Manager
If they are unauthorised then Enterprise Manager won't let them in.
Thanxxxxxxxxxxxxxxx
|
|
|
|
|
If they have the admin password, and access to your network, then there's not anything you can hope to do. Your DB is as secure as your network, no more, no less.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I've answered this question several times now: previous answer[^]
Why won't you accept the answer you were given?
|
|
|
|
|
Wow - we seem to have a flood of people who ask the same question over and over.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Cannot find the certificate 'AccountingCorp', because it does not exist or you do not have permission
here is the sql
USE master
CREATE LOGIN Dave
FROM certificate AccountingCorp;
GO
I created the certificate with this code.
USE Frontier_equipment;
CREATE CERTIFICATE AccountingCorp
WITH SUBJECT = 'Frontier Accounting Records',
EXPIRY_DATE = '10/31/2009';
GO
rkj
|
|
|
|
|
hi again,
I wanted to ask is that I want the users created in my SQL server database to be the one’s used to login to my application as well. As all of us know, generally we create a users Table in the database and use this table to allocate Login ID’s to the employees but I want them to be the users of SQL server db as well so that I can also enable appropriate restrictions on a particular user type. So how can we do that? I know how to create a user in SQL Server but I don’t know how to access the ID and password. What’s the data Dictionary table that holds this information?
Rocky
|
|
|
|
|
It is not possible. Either set a single sql server user and password in the connection string. Or use Windows authenticated users for your sql access.
Ben
|
|
|
|
|
ok then I'd rather go with the conventional user tables
thanks
|
|
|
|
|
Hi every one,
Well I’m building a desktop application for an organization in C# 2.0 and Sql Server 2000 and I was wondering abt putting some sort of restriction so that the user doesn’t access the data in the tables from the Enterprise Manager. So first, plz tell me if this is a good idea or not. Well I think at least some users should not be able to access the tables directly. So how can we put this restriction?
Thanks in advance,
Rocky
|
|
|
|
|
User accounts. Each user connected with the relevant username and password, or via windows authentication (which logs them in with their windows account). You can restrict access based on the account or role.
|
|
|
|
|
Hello everyone,
I’m working on Fuzzy lookup within SSIS package. It is done with the fixed similariry and looking up fields. Right now, we are trying to move to use dynamic varibles for Similarity and looking up fields. That means the similarity value and looking up field values are passed by variables and are assigned values from outside of the ssis package. If anyone has an idea on how to do it, could you please give me a clue. I’m really apprecite your any suggestion in advance.
|
|
|
|
|
Hello,
I am in search of the .NET Framework 1.x and 2.0 and 3.0 class
library maps and ADO.NET class library maps to hang/pin to my cube at
work and also at home. I believe that helps understand more about the
Framework and ADO.NET objects and class libraries. Also if some thing
is presented in a pictorial (grapihical) representation I guess I can
learn more than reading whole lot of stuff.
So is there a place on the net or any company that offers this kind of
to buy or down load?
Any inputs or help me finding on this is greately appreciated.
Thanks in advance,
-L
|
|
|
|
|
Hi,
can enybody know, if possible encode all database?
Problem is that, I have database and application, which are offer to user. And I don't want user could to browse database without using application.
thank for every suggestion
Pavel
|
|
|
|
|
I would think it would make more sense to only give access to the application to access the sql database and remove all other access. So if you application is using a sqluser name and password for its connection. Only give that user access.
If that is not an option. Then another possibility is to make sure all of your database access for you application happens through stored procedures. In which case the user would not need select access to any of the tables only execute rights on the stored procedures.
Hope that helps.
Ben
|
|
|
|
|
Thank you Ben,
it's good idea and if I distribute database file than the stored procedures are enclosed in database files and with rights too?
I read about encrypting, but it is only for column not all database.
I hope, that it is last question.
Pavel
|
|
|
|
|
When you distribute the database you can set up the user rights to the tables. Unfortunately, if they are the ones that installed sql server then they would have an SA account which would allow them to change their access and read their tables.
I think if you can not control your users access to your database, you will have trouble short of encrypting each column which would affect performace.
I have seen other programs like Microsoft great plains, where all of there access is through stored procedures which are encrypted. Then all the tables have names that are like IV10001. That way it is not easy for users to understand what the table is. Still if your users can or will have SA access to your database they will be able to decrypt the storedprocedures.
Sorry I couldn't be more help.
Ben
|
|
|
|
|
I feel it will be problem. But thank you for you answer and time.
Pavel
|
|
|
|
|
How can i make my database more and more secure so that unautorised user cannot have access to my database by Enterprises Manager
Manoj Bisht
|
|
|
|
|
The Knowledge wrote: How can i make my database more and more secure so that unautorised user cannot have access to my database by Enterprises Manager
If they are unauthorised then Enterprise Manager wont let them in.
|
|
|
|
|
Hi All,
How can we lock and unlock the database
Manoj Bisht
|
|
|
|
|
What do you mean by that? You can lock bits of the database just by selecting rows. The database will temporarily lock those rows so that the SELECT can get a clean result set out.
|
|
|
|
|
Hi guys, I've got this problem, hope someone can help me out.
I've written and application and it works fine on my computer and i can connect to SQL through a Text file
connection string in the Text box : Data Source= NameOfMyDataSource;Initial Catalog= DataBaseName ;Integrated Security=True
As I said, it works fine on my computer but NOT on other computers !!!
I installed my application on another computer and also installed SQL server, then attached my database and it works fine, but when i run my progran and enter ID and Pass get this error !
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Please help me out !!!
Thanx in advance
Mr.K
|
|
|
|
|
It seems that someone else (our web company) are able to login to it and the server is external to them as well. Any ideas?
Can you connect if you specify the IP address & port number instead of the host name? Is there a firewall in the way?
Regards,
Satips.
|
|
|
|