|
In Windows XP Home Edition, when trying to list MSDE servers using C# and SQLDMO the list is empty. For instance, when doing
SQLDMO.ApplicationClass DMOApp= new SQLDMO.ApplicationClass();
SQLDMO.NameList names=DMOApp.ListAvailableSQLServers();
I get names.Count=0.
Can anybody point me in the right direction?
|
|
|
|
|
hi
i have a declared a string which i want to write to a text file
using the bcp command
i have so far
declare @String varchar(300)
exec master..xp_cmdshell 'bcp @String queryout @String -o z:\callparent\text.txt'
which is not working
does ne1 have any idea's im not that familar with bcp
thanks
si
|
|
|
|
|
If you are trying to use the contents of the string @String in your BCP command, you need to do the following:
declare @cCmd varchar(400)
declare @String varchar(300)
-- populate @String....
select @cCmd = 'bcp ' + @String + ' queryout ' + @String + ' -o z:\callparent\text.txt'
exec master..xp_cmdshell @cCmd
onwards and upwards...
|
|
|
|
|
Hi,
How do I get all database name in SQL server 7?
Thanks.
H.Dung
|
|
|
|
|
SELECT name FROM master..sysdatabases
|
|
|
|
|
Is there an easy way to "archive" a database so that a user can see what has changed since the last time it was modified...while also tracking all previous modifications on it as well? The contents of this database would change very rarley.
Thanks
|
|
|
|
|
Probably the easiest way would be to add a time stamp to the record, not backup the entire database.
|
|
|
|
|
Got an application here at work on Access, and its getting large, so I wanted to go with SQL Server 2000.
Now from one group that installs the servers has blocked us, saying its not approved. Funny, becuase that group was outsourced to IBM.
Never the less, we now have to port just the database to Oracle or DB2, and can't make up my mind. The business logic and client apps will stay the same. Only heard horrible things about Oracle, and as for DB2, we only use it here on one of our mainframess. What I'm worried about is any funnies when using ADO to connect to these. I know its fine with SQL Server as I've already ported the DB.
Opinions please!!
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Well, being that Oracle does stand for One Real Asshole Called Larry Ellison, I would normally advise against it; however, there are specific ADO.NET classes for Oracle (Oracle .NET) so it might be your best option. You could still connect to the DB2 through the OleDb classes in ADO.NET, but then you're limited to what OLE DB can do (more specific, what the OLE DB provider provides ADO). Usually, this is only basic - but that may suit your needs. The mainframe thing is also a problem for DB2.
My vote is for Oracle (since you can't use SQL Server, which obviously has the best support in .NET).
Good luck!
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
I'll warn you from our experience: give the machine LOTS of memory.
While in a slow period (we're a custom software house, for the most part), we tried out both Oracle's Developer Edition equivalent and DB2's equivalent on, admittedly, a fairly old spec test machine - Pentium 200 with 192Mb of RAM, if memory serves.
SQL Server 2000 (Developer Edition, typically) on this box isn't exactly fast, but it's certainly competent.
Oracle and DB2's user interfaces - the equivalent of Enterprise Manager - are both written in Java and a bit quirky and slow.
Obviously the first thing to try with any new database software is to create a new database.
SQL Server takes about eight seconds. All it has to do is make a physical copy of the model database.
DB2 took about half an hour.
Oracle took all night, ate the entirety of system memory and swap file, swapped to hell and back (we had to kill off some processes to relieve pressure on the swap file), and ultimately failed because the system was using DHCP and had to renew its lease. This caused the connection between the client software and the server - running on the same machine - to break. The client tools couldn't recover.
If you go with DB2, you'll have to install Visual Studio 6.0 on the same system if you want to use stored procedures - DB2 translates your SQL into C, then compiles the C code into a DLL which gets loaded at run time.
For Rapid Application Development, SQL Server is streets ahead.
If you don't need to support many users, I'd go with the SQL Server Desktop Engine[^] (also known as MSDE), which is free if you have a license for Visual Studio .NET, or many other products. See Microsoft's Appropriate Uses FAQ[^]. MSDE has a query governor built in that seriously affects performance if more than five batches are executed simultaneously. The latest download already includes Service Pack 3.
Traditionally SQL Server has been a little more susceptible to security issues - searching for 'microsoft sql server' at http://cve.mitre.org/cve/[^] yields 56 results, while searching for DB2 only finds 3 issues. Searching for 'oracle' produces 70 results. There are probably some false positives in these results.
--
Mike Dimmick
|
|
|
|
|
Wow, that long to create a new database? Ouch. Our Internet-based solution creates a new database for each new corporate account so that each company / branch has their own database. This is done from a template and done as soon as its requested (after some security measures). Good thing we use SQL Server!
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Well, it's possible that we selected the wrong options, that caused it to be really slow. I seem to recall that we tried looking for online help, and found that the online help viewer (not HTML Help, of course :P) was modal to the application.
No, you can't read the help while using the app, why would you want to do that?
--
Mike Dimmick
|
|
|
|
|
Reading help while trying to solve the problem would just be stupid and unnecessary. Of course Larry Ellison would take that option away. Besides, Oracle is self-explanitory and really requires no help to use!
I dunno, even if you did pick the wrong options, that still seems like a long time. SQL Server comes back within a second or two and pokes fun at your bad choice in preferences! But maybe that's just Oracle's greatness hard at work.
Oh, and DB2 is an ancient relic that is steps away from both SQL Server and Oracle. It doesn't really suprise me.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
*sigh*
Ok. You will have some problems with porting either way. SQL servers view of what a DB vs tablespace vs schema is is completely different from Oracle or dB2. Oracle and DB2s are more traditional style which is inline with the SQL workingroup specs. MS did their own thing. It's simple to manage but being compeltely different form eveyone else it makes porting not be a no-brainer.
that's just off the top of my head. there are a number of other differences that will depend on your sue of various featuresets that could also impact you.
As for the time to create/ work on the db that was posted...
Oif. Ok, I can't speak for DB2 because I've not done anything more than read most fo the docs. Most of what I am going to mention apply to DB2 though. In the case of Oracle you hit at least two, maybe three problems. One, I beleive the machine you mentioned is WAY under the mins for Oracle. The base memory footprint for Oracle is arround 200M for a small db so you're swapping constantly. CPU matters to Oracle, but memory is its usually bottleneck. Second one you selected probably to use a started db. In other words the Installation created a db for you. all though these template dbs are ok, they arenot optimized in any way and tend to install ALL the Oracle options. Unless you want to be able to compute the GPS location of a guy standing on the corner in the capital of zimbabwe based on his Zipcode and what kind of cofee he drinks, you loaded WAY too much. Each option increases the memory and CPU requirement, in some case drastically. The other thing I think you probably ran into is, you put all the Oracle Datafiles on one or two physical disks. Oracle is very disk intensive. Putting everythign on a couple disks is a nightmare to Oracle IO -wise. It will just chug. Most Oracle Dbs, even small ones, are laid out on Combined Raid 5 and raid 0/1 disks depending on file type. You can put it on one or two disks but you will pay a performance penalty.
For example, I created a raw Oracle Db consisting of 6 datafiles, 3 redo groups and loaded the data dictionary in about 30 mins on a 600Mhz machine with 512Meg fo Ram.
Please don't compare the tools to the RDBMS engine. The RDBMS engine is very robust and up to most challenges you can throw at it. Their tool selection, on the other hand, is aweful. Oracle bit hard on java ad continues to do so and they haven't figured out a good way to build a toolset that is competitive with third party makers. No ONE that I know of in my area uses the offered tools from Oracle. We all use third party tools whether is somethign we write, something we buy (DB Artisan, TOAD, etc) or in worst case resourt to SQL*Plus which we can all use in a pinch.
Anyay, I'm not gonna bash SQL Server. It's a decent product with its own market and its own faults. Oracle has the same situation.
Mark Conger
Sonork:100.28396
|
|
|
|
|
I need to create an ODBC connection to a remote server (my webserver).
I am trying to populate a combobox from a DB query, but the DB resides on a remote machine.
The remote machine is running NT 4.0
My development machine is Windows98
Is this possible?
TIA!
I'm going to live forever or die trying!
|
|
|
|
|
tnolley wrote:
the DB resides on a remote machine
I'm assuming you are using MS Access, and that this is an ASP App, And that your are running Peer Web Services on your Win98 W/S.
You can share out the folder that the DB resides in:
\\servername\sharename\accessdb.mdb
You can then build your connection string by the following:
<code>Dim ConnectionToDb
Dim rsToDB
Set ConnectionToDb = Server.CreateObject("ADODB.Connection")
Set rsToDb = Server.CreateObject("ADODB.Recordset")
ConnectionToDb.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=\\servername\sharename\accessdb.mdb;" &_
"Persist Security Info=False"
rsToDB.Open "TableName", ConnectionToDb, adOpenForwardOnly, adCmdTable
While Not rsToDb.EOF
Response.Write rsToTb("FieldName")
rsToDb.MoveNext
Wend
rsToDb.Close
ConnectionToDb.Close
Set rsToDb = Nothing
Set ConnectionToDb = Nothing
Tony
|
|
|
|
|
2TallTony wrote:
I'm assuming you are using MS Access, and that this is an ASP App, And that your are running Peer Web Services on your Win98 W/S.
You can share out the folder that the DB resides in:
\\servername\sharename\accessdb.mdb
You can then build your connection string by the following:
Thanks TT. I should have been more specific. I am writing the app in Visual C++ 6.0.
My Windows98 machine is not running any web server or peer-peer networking. The app will be distributed to a wide base of clients running on a minimum of Win95 with dial-up networking.
The database on the webserver is already mapped with a DSN (it is an Access97 DB).
I just need to know how to connect to that remote DSN in VIsual C++ 6.0. I have no experience in using ActiveX components - I tried, but unlike in VB, when you use an Add-in control in VIsual C++ you have to jump through all sorts of hoops to get it to work. I am so frustrated that I am close to rewriting the entire app in VB just to use the @$#(&*#$@!*@#$ remote data connection control.
I think it will be easier to get advice on how to use a remote DB connection from within VC++ but this is now the part of the code that is causing the entrie project to just sit there and gather dust.
Any help would be greatly appreciated!
I'm going to live forever or die trying!
|
|
|
|
|
TN,
Before you re-write your application,
Try posting a message within the VC++ forum, there are many experts at coding the VC++ language that visit this site.
Sorry couldn't help.
Tony
|
|
|
|
|
2TallTony wrote:
Try posting a message within the VC++ forum, there are many experts at coding the VC++ language that visit this site.
I originally posted this thread there.
I found a workaround though - I just ported my DB from Access to MySQL and the ODBC driver for MySQL allows you to specify a servername or IP address - voila!!!!!!!
I'm going to live forever or die trying!
|
|
|
|
|
It depends very much on how your app's written.
If it's an MFC app, look at the CDatabase and CRecordset classes (connecting using ODBC), or CDaoDatabase and CDaoRecordset if you want to use Data Access Objects. For a new app I'd avoid DAO - I don't think MS intends to port Jet to 64-bit processors, and DAO only works with Jet anyway.
If the application is written with raw Win32 API calls, look up the ODBC functions directly - see SQLConnect and its kin.
I'd avoid ADO from C++. It's designed as a nice wrapper around OLE DB for languages that can't cope with multiple interfaces, especially scripting languages. From C++ it's a royal pain of constantly wrapping parameters in VARIANT s and strings in BSTR s.
If you want to tackle it, you can use OLE DB directly. If you're happy with C++ templates, you can use the OLE DB Templates. If you intend to do this, I suggest OLE DB Consumer Templates: A Programmer's Guide[^]. There are wizards for it too - go to Insert > New ATL Object, then select the Data Access category and the Consumer object.
I have tried this out once, but my boss preferred doing it 'a way that everyone can understand', with the odd result that a data import application - which looks for new files to import, then imports them - is written in VB6.
--
Mike Dimmick
|
|
|
|
|
Thanks for the reply!
It turns out that I was trying to connect to a remote Access DB and the supplied ODBC driver for MS-Access does not let you specify an IP address - you must pick a local MDB file to map the DSN.
So, I just converted the DB to MySQL and the ODBC driver for that allows you to specify an IP address for the remote datasource.
Problem solved!
I'm going to live forever or die trying!
|
|
|
|
|
When I add a DataGrid to a form and associate it to the datasource, all the columns are retrieved from the table.
This is fine, but I want to rename those columns. How to do that?
Ex: Columns in table are:
PurchaseDate, MeterReading,....
I want to display the columns in the DataGrid as Purchase Date, Current Meter Reading ...
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
|
Sorry I forgot to mention, the DataGrid was in Windows Forms, not WebUI.
Mark Nischalke wrote:
Turn off the autogenerate columns and add the columns
The AutoGenerateColumns property is only for WebControls.
This is my first take at ADO.NET
"If a jug falls upon a stone, woe to the jug. If a stone falls upon a jug, woe to the jug. Always woe to the jug"." - KaЯl This signature was created by "Code Project Quoter".
|
|
|
|
|
I am trying to pass an array to an oracle procedure using the OracleClient for .NET. I can't find away to do this/ I have trawled the net and have found a few people trying to do the same thing but no solution. The only solution given was to pass the array as a delimited string, but this is no good for my purposes as the array could get quite large.
Thanks in advance for any suggestions
Ian
|
|
|
|