|
Hello,
I have a database design problem,
I'm using MS Access databases btw.
I have several tables, which need to be syncronised between databases.
There are 3 databases and records can be added to any of the 3 and need to
be updated on the others.
Table T1 has a primary key which is referenced by T2.
Now to make an update to a remote database I came up with the following.
Create a table called Database which has an unique ID.
Create a table called Mapping which has the following
Id (AutoNumber)
TableId - unique number 1- T1 , 2-T2
DatabaseId - Id from Database Table
RemoteId - Remote Id of this entry
LocalId - local Id
To syncronize, when a remote client connects to the local database, it goes through table T1, and looks in the Mapping table for the localId, with its DatabaseId. If it is not found, it is a new entry and creates a new T1 entry on its (remote) database. It also creates a Mapping entry on the local database and remote database.
Does this sound like a good plan?
Or are there existing methods which work better?
Cheers
John
|
|
|
|
|
I have done a db program.Using ado to access oracle806 db,I used Oracle OleDB provider to improve performance.
It's fine on my pcs(xp/98,oracle 817 client) .However ,
After release it(using vc++6.0 install shield),it does not work on some pcs.It seem program do not connect to oracle.
On others,it work well.Try connecting the oracle with SQL*PLUS,i find the net8 is ok.What's wrong with my program? I suppose the program is Oracle OleDB provider.
Help me ,please.
|
|
|
|
|
Greetings,
I am getting an exception when I use Append and adDBTimeStamp when creating a table with this parameter.
I am using visual c++ .net.
Here is my code below.
tblNew->Columns->Append(_bstr_t("MyDate"), adDBTimeStamp,0);
I get an exception when I try to create this, can anyone give me some advice?
Thanks in advance!
|
|
|
|
|
What exeption you get?And do use sql or access?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hello,
I am using sql server.
It doesn't give the exception name, and it skips the exception handler below.
catch(_com_error &e)
{
}
I did get it to work using "CREATE TABLE", and using a "datetime" parameter,
so I do have a workaround. But it seems that the ADOX call didn't work.
I can't seem to get my query working now. Here is a query I had previously used
using ADO to query an Access database, but does not seem to work with SQL server.
The query:
----------
USE MyTestDB
SELECT *
FROM MyTestTable
WHERE StartTime>= #10/11/2002# and StartTime <= #11/11/2002#
It complains about the "#" symbol and says it is a syntax error.
Any ideas as to what symbol I should use in it's place, or a different way
to do my query.
Thanks for answering my post!
|
|
|
|
|
Use ' instead of '#'.Access ans sqlserver have some differences in some syntax.And also I dont think you need USE MyTestDB.You have to login to that database with your connection string.For your other problem,I suggest to see the samples of MSDN about 'Append' and other functions that you use
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Thanks for the tip about the "'" symbol, and the msdn "Append"!
|
|
|
|
|
I am trying to write a tool to help me explore my MSDE databases, and I can connect fine, but I cannot figure out how to enumerate the available databases or tables so that I can show them. Any help appreciated.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi, Christian:
You can use ADOX for more serious work, the sp_help stored procedure or use the not-so-documented system tables for this:
select * from master.dbo.SysDatabases
User tables:
select * from SysObjects where type = 'U'
System tables:
select * from SysObjects where type = 'S'
[edit]
You can also try this in SQL Server 2000:
select * from INFORMATION_SCHEMA.TABLES
[/edit]
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Daniel Turini wrote:
select * from INFORMATION_SCHEMA.TABLES
This also works in SQL Server 7
Dave.
|
|
|
|
|
Davey wrote:
This also works in SQL Server 7
I should have say "I've only tested it on SQL Server 2000"
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Thanks, but while this has got me started, the fact is that I can't find a way to list all the tables of a specific database.
Daniel Turini wrote:
select * from INFORMATION_SCHEMA.TABLES
is listing everything in master, but nothing from Northwind, the other DB I have created, or any others.
I don't want to use ADOX if I can avoid it. I'm hoping I can do something like select * from TABLES where DBName = 'Northwind'.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
As usual, as soon as I ask, I solve it
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hello,
I would really like to use .NET for an application that has a website interface and a windows downloadable C++ MFC application. Both need a database backend.
For the web application, I have chosen, ASP and Access ( migrate to SQL 7 later)
For the windows C++ MFC app, the choice is not so clear.
I need the smallest possible size for the windows download and it needs to be backwards compatible to windows 98.
Even using access would require the MDAC redist which is 5MB...too large.
I thought about writing my own small database interface,
however it feels like reinventing the wheel.
.NET would do the job nicely, but a 20MEG download???
Fine for people with cable but not for 56k's
Any other suggestions?
Cheers
John
|
|
|
|
|
I would structure this as follows:
For the web application: ASP.NET. Easy to develop, fast, scalable and, because the server is only 1 machine, a one-time 20Mb download will not be a hassle.
For the client: MFC C++ application. Obvious solution.
It's not clear why you need databases on the client: accessing the server database or a local "cached" database?
A) Accessing the server database: develop a web service. It's fast and as easy as running a wizard on VS.NET. The client side is easier with C# or MC++, but even with MFC is a matter of using a couple of CInternet* MFC classes and a bit of MSXML for parsing the resulting document. It's fast to develop and flexible.
B) Local database: if the database is small, you can replace it for a small XML file. This way you do not need to reinvent the wheel, and do not become "glued" to a proprietary file format.
Remember, a XML file is not a high-performance solution for massive database manipulation, specially if you need lots of "GROUP BY", but for simple searchs and updates, MSXML is quite fast and can be a compatible solution with Windows 98.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
For the Client:
It will be offline mostly which is why the need for a local cached version. It requires alot of add, del, insert,select, update operations to be done on the local database.
A) accessing server database
I had considered using MSXML(XMLHTTP ) for the accessing the server database, but hadnt considered using MSXML for the local database.
Not sure if MSXML is appropriate for database solution.
Is a small DAO redistributable still availble from MS?
In that case I could use DAO?
Cheers
John
|
|
|
|
|
johnb wrote:
Is a small DAO redistributable still availble from MS?
In that case I could use DAO?
Argh!
I would keep a safe distance from DAO, if I were you.
And I have some nightmare stories I lived with MDAC redistributables, too
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Maybe ADO is the answer, XP, 2000 already have a version of MDAC installed,
I guess, win98 users will have to install MDAC2.7 approx 5MB download.
|
|
|
|
|
MSDE is basically SQL Server with no fancy GUI and only 5 connections at a time. It's designed so I can write an app without needing to buy SQL Server, then my customers can use it with SQL Server, but if you don't need more than 5 connections at a time it might be worth a look.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
yeah had a look at MSDE, whats the redist size?
|
|
|
|
|
Hi all
No, this aint personal
I have made a SQL DB with a couple of related tables but were a bit "lazy" setting up relationships, basically each relationship were setup with all the options unticked. However, I realise now that some options are obviously necessary, like checking on creation, but I'm not really sure what all the options do.
Firstly I would like to know what does each one do, and how it affects the tables (like when deleting records) , and secondly how to get rid of the couple of "rogue" entries I have in my tables that does not link to anything as I deleted them (to test mind you ).
Help appreciated
"I dont have a life, I have a program."
|
|
|
|
|
You really should read my article: SQL Server DO's and DONT's[^]
But for the "phantom" child rows, if the tables are not too big (this is not a high performance solution), you can run a simple DELETE:
[I'm assuming a master table and a detail table and ID as the primary keys on the tables.]
DELETE detail
WHERE ID not IN (SELECT ID from master)
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|