|
Check Update() function of OleDbDataAdapter and GetChanges() of DataSet .
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Thanks! I'd already discovered that, but didn't want to answer my own post
Best regards,
Alexandru Savescu
|
|
|
|
|
Example from SQL Server Books Online: To bring a standby server up after the primary goes down:
-- Restore the initial database backup on the standby server.
USE master
GO
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the next transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH STANDBY = 'c:\undo.ldf'
GO
-- Repeat for each transaction log backup created on the
-- primary server.
--
-- Time elapses.. .. ..
--
-- The primary server has failed. Back up the
-- active transaction log on the primary server.
BACKUP LOG MyNwind
TO MyNwind_log3
WITH NO_TRUNCATE
GO
-- Apply the final (active) transaction log backup
-- to the standby server. All preceding transaction
-- log backups must have been already applied.
RESTORE LOG MyNwind
FROM MyNwind_log3
WITH STANDBY = 'c:\undo.ldf' -- QUESTION 1: Why not just use "WITH RECOVERY" here??
GO
-- Recover the database on the standby server,
-- making it available for normal operations.
RESTORE DATABASE MyNwind
WITH RECOVERY
GO
Question 2:
I dont understand the use of the "undo" file. I mean, before u bring the standby online, u're going to apply the last transaction log anyway. And I presume u BACKUP the last log WITH NO_TRUNCATE - so, all uncommitted transaction will be backed up.
And in this case, why do we need the "undo" file?
QUESTOIN 3:
I really dont understand:
>Database Maintenance Wizard
>"Specify Log Shipping Destination"
>Add
>"Allow database to assume primary role", and Database Load State: "NORECOVERY", "STANDBY".
I tried different options, and all resulting destination database became "Read only" whether i put them on "NORECOVERY" or "STANDBY".
I thought NORECOVERY and STANDBY assumes the same meaning as in RESTORE DATABASE WITH NORECOVERY/STANDBY.
In NORECOVERY case, I expect that I cannot even READ from the destination database (but, problem, I could read from it using SELECTs, in my little test?). In case of STANDBY, only read permitted, no write (okay, this has been confirmed and i have no problem)
And documentation for "Allow database to assume primary role" is as follows:
"Specify if the destination server should be setup to be able to function as a primary server."
what da?? All destination database has been marked "secondary" and "read-only" under database properties even after i checked the "Allow database to assume primary role" checkbox!?
what lousy documentation..
Help! Been reading on this all day and toying with it, but still havent found a clue as to why...
thanx, any help will be appreciated!
norm
|
|
|
|
|
How do you autoprompt for an ADO connection in Visual C++?
The code below shows how it is done with VB.
Set DBConn = New ADODB.Connection
With DBConn
.Properties("Prompt") = adPromptAlways
.Open ("driver={SQL Server};server=" & gServer & ";database=" & gDatabase)
End With
Thanks in advance for you help
Bill Ferreira
|
|
|
|
|
if you are working with MFC use CDatabase. Call Open and pass the following for the parameters: Open("", false, false,"ODBC;" ,TRUE)
|
|
|
|
|
Hi
I'm using an Access database with the Jet engine for my application. There is a requirement for the user to take the database home (sounds like a job for database replication I here you say) and that would be great... However, the only documentation I have seen is in VB... DAO and JRO are the tools that the MSDN suggests but gives not examples.
I would like to provide this replication facility within my app and not have to force the user to open access and do it from there. can anyone help?
Thanks in advance
Steve
|
|
|
|
|
I've done that programatically in Visual C++ a few years ago. But don't have the code with me (I'll look for it, can't promise you anything)
There is an article un MSDN:
Implementing Database Replication with JRO
Wich is pretty good, the downside: is in VB, but you should be able to translate it.
Is totally doable.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Hi,
Any body can guide on how to connect to AS400 DB2 files using C#?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
I need to develop an application for multi user (8 users / time) which MSDE will not allow me to do because it allows max 5 users/time. I personally like DBF files but I have a problem in saving the user's prefrences & password. Can any one guide me please?
Jassim Rahma
|
|
|
|
|
I am doing the folowing operations:
1. Export some tables (that have unique IDs and foreign keys) to an XML file using a DataSet object in .NET. This works file.
2. I want to be able to import that XML file into another SQLServer server that has the same database architecture, but of course, different data.
3. When reading the XML file into a Dataset and then updating the database, some key violations or duplicate records may occur because I exported some unique IDs from one databse server and am trying to import them into another server. Thus, when importing a master table, I must read the XML file and give the corresponding records new IDs accordingly. Since my master table will have several slave tables with foreign keys involved I would have to udpate the slave tables also to maintain the integrity.
I could do all that manually by having lots of structures and maps and hash tables. Is there a change .NET Dataset would take care of everything automatically for me?
Best regards,
Alexandru Savescu
|
|
|
|
|
hi, i have 3 questions regarding communication protocols used by sql servers... hope someone can give me some direction, i read the "help" and some books, didnt find anything...
QUESTION 1: how can u ping a sql server instance?
for example:
ping www.myserver.com:1433 (for default instance)
ping www.myserver.com:3333 (some designated port for a named instance)
is this correct? any why do i have to configure thru both?
a. client network utility (i thought communication protocol used by an application is really up to the client application itself? why do we need to configure it thru sql server)
b. server network utility (this i understand, but one more question. let's say we installed a few protocols, when a client connection comes in, is it SQL server that's responsible for detecting the protocol used by the client connection? and it's SQL server that pick the matching protocol - if available/installed?)
QUESTION 2: "force protocol encryption" in "server network utility"
a. what does it mean? to encrypt "out-going traffic"? or "incoming traffic"? How does this work between server and client?
b. If this checkbox is available on the main dialog, then why can i also configure "Enable Encryption" under "multi-protocol" encryption?
c. And how can i enable SSL for TCP/IP? Under "properties" for TCP/IP (in SQL Server Network Utility), i cant find any "Enable SSL encryption" checkbox?
d. "protocol encryption": which layer? I presume they just encrypt application layer header rite?
QUESTION 3:
what about named pipe? I have no idea what name piped really means... Can i type the "named pipe" from a command prompt and "ping" the resource as if I am using TCP/IP?
I know it's a protocol used by SQL server, but is this all i need to know?
Thanx!!
norm
|
|
|
|
|
norm wrote:
ping www.myserver.com:1433
Ping only works at IP address level. If you need to connect to a specific port, try Telnet.
norm wrote:
a. client network utility
norm wrote:
b. server network utility
SQL Server needs to know which protocols are enabled. The Server Network utility is used for that. The Client Network utility is used to configure which protocols are enabled on the client. If the client app specifies a network library to use, as long as it is enabled on the client and the server, everything should be OK. AFAIK, if the client doesn't specify a protocol, it will try the available protocols until it finds one that works.
norm wrote:
QUESTION 2: "force protocol encryption" in "server network utility"
a. AFAIK, it encrypts both ways.
b. I can't see that option.
c. The protocol encryption is SSL encryption.
d. No idea.
norm wrote:
QUESTION 3:
what about named pipe?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpic/html/msdn_npipes.asp:
A pipe is a simple data transfer mechanism that works, well, pretty much like a pipe: You stuff things in one end and the things come out the other end. You can establish a pipe both locally (using either so-called anonymous pipes or named pipes) and to a remote machine (a named pipe). In order to be able to utilize a named pipe over a network, one machine must have created the pipe (the server), and another machine that wants to use the pipe (the client) must know both the name of the server machine and the name of the pipe on the server machine.
|
|
|
|
|
Hi, all.
a table named Employees, which has one column named "Name" and 3 records, like below:
Name
-----
Mike
Tom
Jacky
now i wanna display one more column named ID, which is a continuous integer, let the result like:
ID Name
------------
5 Mike
6 Tom
7 Jacky
how to write this query can make this result(using ms sql)? thanks a lot.;)
|
|
|
|
|
Do the Name values have to tie up with a specific integer value in the resultant table?
If not, why not give this a try:
1. Move Employees data into temp table
2. drop Employees table (or backup)
3. recreate new Employees table with ID and Name field
4. Iterate thru temp table and fill new Employees table.
...done.
Does the ID field have to be a PK?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Hi! This is my first post here - hope you'll help me easily!
First of all, I'm using ASP with an Access DB. I need the SQL expression or some ADO instructions to get only n records starting from a record of which I have the primary key value.
If I had the record number it would be easy, but I don't have it, I only have the random primary key...
Thank you in advance
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
You're probably going to have to use a client-side cursor with Access.
But, here are couple of questions:
1. how many rows are there?
2. are you sorting the resultset?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Mhhh... what's a client-side cursor with Access?
The rows are ~2000, but they will grow maximum to 10000, I think...
Yes, the results are sorted.
This is the code I use to display the messages from record M to record N...
Sub WriteMessages(startAt, nEndAt)
Dim indent_level, strSQL
strSQL = "SELECT TOP " & nEndAt - 1
strSQL = strSQL & " id_msg, id_thread, placement, reply_count, date, id_autore, author, subject, text"
strSQL = strSQL & " FROM Bacheca"
strSQL = strSQL & " ORDER BY id_thread DESC , placement"
Dim rstThreads
Set rstThreads = Server.CreateObject("ADODB.Recordset")
rstThreads.Open strSQL, adminDBConnString
rstThreads.Move(startAt - 1)
do until rstThreads.EOF
indent_level = (Len(rstThreads("placement")) - 1) / 4 + 1
WriteMessage indent_level, rstThreads("id_msg"), 'Lots of parameters here
rstThreads.MoveNext
loop
rstThreads.close
set rstThreads = nothing
End Sub
I want to do the same thing, but starting from a certain record, whose number I don't know, but that has a certain value as primary key.
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
I need to get schema info (viz: primary/foreign keys, indexes) for a table in access.
Am I able to use ADO.NET or do I still have to use ADOX?
Any code samples?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
If Access is now running off MSDE, why am I not able to select from the system tables as in SQL personal edition?
Any ideas?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Say I have two queries that are of a similar structure, and take parameters for a client ID e.g. from ADO I would call them like..
First Query
{CALL qData1 ('Mr Bob') }
and the Second Query
{CALL qData2 ('Mr Dave') }
If I wanted to use these in a Union how would I build it, as I cannot seem to figure out how to use Queries/Stored procedures with parameters in a Union.
Any ideas?
|
|
|
|
|
I have a datagrid which I use to update a table but I have a little paging problem
when I add a new entry I would like to page to the last page but I do not know which is the last page as it could have incremented by the addition of the new record.
is there a way of seeing from the datagrid or dataset just how many records there are (or were) or should I just do another query on the database to get a recordcount. Its probably in there but I just can't see the wood for the trees.
Thanks again
Shaun
|
|
|
|
|
ShaunW wrote:
I do not know which is the last page
Maybe pagecount property is what you want.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have an access database mounted via an ODBC datasource
I can view it in the solution explorer but when I try to access it I get the following message 'You cannot use an OLE DB provider for ODBC drivers'. What does that mean? How do I access the database via this route.
I can view the same database if I use the jet drivers however the jet drivers treat my date/time fields as pure date fields and so I lose all time (hours,mins,secs) information.
Please help
Shaun
|
|
|
|
|
okay I've switched my database to SQL 2000 and that version of datetime works fine - but if anyone can help with the above it would be appreciated.
Shaun
|
|
|
|
|
The error message means that you cannot use the OLEDB Provider for ODBC to access an ODBC datasource through the System.Data.OleDb objects. You need to download the ODBC.Net provider from Microsoft and use that instead.
|
|
|
|