|
So a summary of the problem is as follows.
There is ONE database server - one physical box.
On that server there is database A.
On that server you created database B.
On your client box you CAN do the following with A (NOT B.)
- Create an ODBC connection and validate it.
- Via a NEW Access database, create a linked table to it
And with Database B you CANNOT do the above.
Given that we know for sure that is NOT a connection problem (per the other response.)
And the driver shouldn't have anything to do with it.
What it would suggest to me is that it is one of the following
1. User permissions on the database B. This is most likely.
2. Some odd firewall rules. This is hypothetical but I don't consider it impossible. Such a rule would need to be more than just a standard connection rule.
|
|
|
|
|
I am going to have data that will be represented in code by multiple flag-type enums.
Is it preferable to store this data in a database record as the integer value of the enum instance, or should I have a separate field for each value and store either a zero or a one to indicate whether that field is in use?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Store the numeric value and have a translation/referential integrity table.
And see my GenOmatic[^] article.
|
|
|
|
|
Richard Andrew x64 wrote: I [...] have data that will be represented in code by multiple flag-type enums.
..and what's the relational representation of the same data?
I are Troll
|
|
|
|
|
Well, I'm writing a rules engine and it will go something like this:
Where subject A, B, C, and/or D
performs function A, B, C, and/or D
raise alert A, B, C, and/or D.
And each record in the database will represent one rule.
So the choices from A to D will be represented in code by flag enums.
And I'm wondering if it's better to store each of the choices as the int value of the enum, or as separate fields.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Then think of the typical searches you expect to perform on the data; that should tell you the most fitting answer.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Richard Andrew x64 wrote: So the choices from A to D will be represented in code by flag enums.
That description sounds more like a 'name' to me rather than an enum.
|
|
|
|
|
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
|
|
|
|
|
You can use datepart to retrieve the month number in SQL Server.
|
|
|
|
|
Which database system?
Doesn't SQL server use DatePart?
|
|
|
|
|
In MS SQL server you can use MONTH(mydate)
|
|
|
|
|
Have your Google powers abandoned you? looking for SQL date functions, you would easily get this page[^] that summarizes it all.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
you can simply use select Month(getdate()) to display month in number.
|
|
|
|
|
Dear Alll,
i have the following:
Set t = classdb.OpenRecordset("select unit_price from contract_details where item_classification_id = '" & Me.Text12.Value & "'";)
when it runs it give me this error : DataType mismatch in criteria expression
but the item_classification_id is a number feild (using access 2007), and Me.text12.value returns an integer. i have checked it 100's of time, it drives crazy...
may be am missing a thing , am not that good in coding, any clues ???
Regards.
0 will always beats the 1.
|
|
|
|
|
You are enclosing the value obtained from the Text12 textbox in single quotes. That's correct for a text value but not for a numeric value - hence your data mismatch error.
Modify your query as follows:
Set t = classdb.OpenRecordset("select unit_price from contract_details where item_classification_id = " & Me.Text12.Value & ";")
|
|
|
|
|
thanks aloooooot
regards,
0 will always beats the 1.
|
|
|
|
|
Hello,
Our production and development databases are on the same server, due to the complexity of the system. is there a way, that I could not have the production server active, when I open the database server? I do not want to accidently connect to this.
Thanks!
|
|
|
|
|
Can you create a different password for the production server database?
|
|
|
|
|
Depending on what DB server you are using, you can also assign different users to the databases.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Both instances of databases are on the same server, this is sql2005. Once you add a login, it is by default to all the databases that exists on that server, right?
|
|
|
|
|
I'm not an expert on SQL2005, but check the GRANT SQL keyword. You should be able to create a user and grant that user access to only a single DB.
I don't think there's any way to restrict the administrator from accessing a db, though.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
You can create a login on a SQL server, but you still need to associate it to a User in a database and grant that user specific rights in that database.
For example, I created a user, pm_user, which is valid in the PM database, but has no access to the "Sandbox" database. When I try to execute the following SQL,
Use Sandbox
GO
I get the following error message:
The server principal "pm_user" is not able to access the database "Sandbox" under the current security context.
This shows that a login is not the same as a user and with a single login, you can restrict the databases the user has access to.
Hope this helps.
David
|
|
|
|
|
vanikanc wrote: Both instances of databases are on the same server, this is sql2005. Once you add a login, it is by default to all the databases that exists on that server, right?
Wrong. A login to a server does not automatically grant access to databases on that server.
|
|
|
|
|
vanikanc wrote: Our production and development databases are on the same server, due to the complexity of the system. is there a way, that I could not have the production server active, when I open the database server? I do not want to accidently connect to this.
Obviously the best solution is to use two different servers.
That precludes other problems as well such as run away queries that cause CPU overload, or timeouts due to long running processes.
Myself I test against the database server which runs on my development box.
But as noted by others very careful use of users and permissions would entirely preclude overlap.
|
|
|
|
|
Hello!
Im trying to set up a Continuous Query Notification between our oracle database and my c# service, but can´t seem to get it to work. This is the method I have for making the connection:
private void SubscribeToTable(string tableName)
{
Log.Write("Add listener: " + tableName);
OracleConnection con = DataBase.GetOpenConnection();
OracleDependency dependency = new OracleDependency();
dependency.QueryBasedNotification = false;
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "Select * from " + tableName;
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
dependency.AddCommandDependency(cmd);
cmd.Notification.IsNotifiedOnce = false;
cmd.AddRowid = true;
cmd.ExecuteNonQuery();
con.Close();
con.Dispose();
}
And when I run this I get a row in user_change_notification_regs with these values:
42 4 net8:
and this is the callback event:
static void dependency_OnChange(object sender, OracleNotificationEventArgs eventArgs)
{
Log.Write("Table has been Changed");
Log.Write(eventArgs.Source.ToString());
Log.Write(eventArgs.Info.ToString());
Log.Write(eventArgs.Source.ToString());
Log.Write(eventArgs.Type.ToString());
}
My problem is the callback-event never runs. Has anyone else had this problem?
|
|
|
|