|
How to convert from sql to oledb as "Catch Exp As oledbException
If Exp.Number = 2627"
How to modify this program? Could anyone let me know to slove it program?
|
|
|
|
|
I'm a veteran web apps developer who is now interested in building more desktop-oriented apps using C#/.NET, since it provides such an elegant framework for doing so.
I'm quite experienced in using sql server in all types of web applications with all types of technologies, however, what I'm not so familiar with is using MSDE as an alternative to access in stand-alone windows apps.
What I'm looking for are some "beginners" guides on how this is done.
How do I package a sql server database into an MSDE db and then package it up with my desktop apps so they're "stand-alone" from a database server?
How do I transfer an existing sql server database into an msde db and use it separately from a database server?
I've only so far been able to find very vague examples on the web on how to do these things.
Thanks in advance!!
-v
****************************
V. Jenks
www.scientifik.com
|
|
|
|
|
emm... If you are familiar with MS SQL, then msde is not a trouble for you, except you does not have GUI interface to manage it... but the best thing is you can always use MS SQL Enterpise Manager to manage it.
knowledge is power
|
|
|
|
|
MSDE IS Sql server, just with fixed tuning optimized for about 5 users, 2GB limit on Database size, no replication publication, no OLAP, etc. and no GUI tools.
The MSDE redist will install SQL server on your clients machine. The silent install has a lot of assumed defaults (C so you may want to study how to modify the redist install scripts to customise the installation.
Aroogala wrote:
How do I package a sql server database into an MSDE db and then package it up with my desktop apps so they're "stand-alone" from a database server?
How do I transfer an existing sql server database into an msde db and use it separately from a database server?
MSDE database == SQL database (same data files...): You can create databases with SQL developer (or any other "full" edition), detach them and have your install process attach them to the new server, aternatively you could export scripts and create the client db by reading the scripts during your install (osql is included with MSDE).
Restoring a backup also works...
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
I am creating tables dynamically using stored procedures, and would like to use a parameter variable as the table_name identifier. The SPs are implemented in T-SQL scripts. I am currently using literal identifiers as usual, then renaming the tables via sp_rename. For example (with SET QUOTED_IDENTIFIER ON):
CREATE PROC spCreateTable (@TableName sysname)
AS
BEGIN
CREATE TABLE "_TempTableName_" (
)
EXEC sp_rename '_TempTableName_', @TableName --rename to desired name
END
GO
Does anyone know how I could use @TableName directly or indirectly in the CREATE TABLE statement?
|
|
|
|
|
CREATE PROC spCreateTable (@TableName sysname)
AS
BEGIN
declare @Tb NVarchar(80)
select @tb = N'[dbo].[' + @tb + N']'
CREATE TABLE @Tb(
) ON [PRIMARY]
END
GO
works for me...
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
That was what I originally did, but I keep getting invalid identifier errors with SQL Server 2K. I was hoping this was just something specific to T-SQL, as opposed to the syntaxes I am more familiar with. There must be a switch I'm incorrectly setting somewhere, since your script files parse correctly. Thanks for confirming my original approach is not what I need to change.
Cheers
|
|
|
|
|
Hmmm.. This works fine with SQL 2k for me, However I usually don't change the Quoted Identifiers from the default (which I believe is off...). I always rebuild the table name into an NVARCHR local variable and delimit with the []. I think whwn we went from SQL7 to 2k the table owner part also became necessary [dbo].
The invalid identifiesr error suggests either white space or illegal characters in the name...
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
Hi all - I have ten application servers all running mdac 2.6 RTM. Each of the client's applications are running fine.
However, I also have an in-house VB utility that needs to be ran periodically. When this is ran, it fails with an "Unable to load dll" error.
I tracked this down to the msadodc.ocx (ADO Data Control). The project compiles fine on 9/10 servers, but on this one I can't even add the ado control to the toolbox.
I've tried the following steps in vain trying to fix this problem:
1. Unregistered & Reregistered the file (successfully)
2. Reviewed & checked for dependencies using the dependency walker.
3. Utilized the MDAC Component checker for inconsistencies.
4. Verified all registry entries & GUIDs.
5. Ran the VBCli.exe to ensure all development licenses were OK.
All servers are running VB Enterprise sp5.
I don't want to upgrade MDAC to 2.7 as this may cause problems with existing applications...ANY IDEAS AT ALL WOULD BE APPRECIATED!!!
Thanks!
|
|
|
|
|
I noticed that when I use Addnew() followed by Put_Value()and don't call Update(), the values are stored in the database. I'm using VC++ for this. Any ideas as to why this is.
Thanks
|
|
|
|
|
Oracle Listener
Hi
when trying to connect oracle 6i to 8i on the same machine, i'm getting this error message:
ORA-12224:TNS: no listener
i think i have to turn the listener on.
How can i check the status of the listener?
How can i turn it on?
i'm running Win98.
thank you
|
|
|
|
|
What do you mean by connect 6i to 8i? If you mean using 6i client to connect to 8i server, then won't work - need as a minimum 8 client.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Im trying to use ADO in Visual C++. I would like to retrieve each field type.
ie , text, int etc
Thanks
|
|
|
|
|
Use get_Type property of the Field object
|
|
|
|
|
How do I add a timestamp to SQL db?? I am using CDatabase and CRecordSet.
Thanks,
grahamoj.
|
|
|
|
|
Hi,
Can anyone let me know if the usage of typed datasets in ADO.NET has any serious limitations compared to untyped datasets ?
Thanks in advance,
Kanchana
|
|
|
|
|
Usually it's untyped datasets that are considered more limited than typed ones, unless you are accessing data you know little about. However, it really depends on what you want to do.
Typed datasets essentially just means the types are known and understood, whereas untyped ones are generic, and hence less is known (and needs to be known). Typed sets are much more efficient, since more work is done at compile time than at runtime. Also, typed sets can do more error checking to avoid mistakes. Commonly, the goal is to use typed sets whenever possible.
Untyped sets can be a little simpler at first, since less needs to be specified, column names do not need to be known, etc. If you do need to work with untyped sets at some point, it's useful if you can have a schema automatically generated, so you can move to typed sets. That will depend on the situation, though.
If you do not consider needing to know what types to deal with to be a problem, then I cannot think of any serious limitations with typed datasets.
Cheers
|
|
|
|
|
I need each param parsed out of this string. I am having trouble parsing if the vars vary in length.
Data: ec=TTT&oc=CRM&tot=501&UID=88997
<br />
(SELECT<br />
ID, IP, TID, TheUserDetails.UserID as UserID, <br />
--Parsing<br />
Querystring,<br />
SUBSTRING(Querystring, CHARINDEX('ec=',Querystring) + 3, CHARINDEX('&', Querystring) - 4) as EC,<br />
SUBSTRING(Querystring, CHARINDEX('oc=',Querystring) + 3, CHARINDEX('&', Querystring) - 4) as OC,<br />
SUBSTRING(Querystring, CHARINDEX('tot=',Querystring) + 4, CHARINDEX('&', Querystring) - 5) as TOT,<br />
SUBSTRING(Querystring, CHARINDEX('uid=',Querystring) + 4, 50) as UID<br />
FROM WebLog l LEFT JOIN<br />
dbo.TheUserDetails ON <br />
l.TID = TheUserDetails.TrackID)<br />
Alex Polajenko
|
|
|
|
|
Alex
If the parameters are always in the same order then couldn't you use something like:
SUBSTRING(Querystring,<br />
CHARINDEX('ec=',Querystring) + 3,<br />
CHARINDEX('&oc=', Querystring) - (CHARINDEX('ec=',Querystring) + 3)<br />
) as EC
The third argument for SubString calculates the size by finding the difference between the starting position of "oc=" and "ec=". Note that I haven't tried this because I'm at a client's site today.
Good luck
Andy Harman
|
|
|
|
|
Hi,
I have a datagrid bound to a dadaset table. I programatically added a new row. I wonder what is the easiest way to make the current cell or row to the newly added row in the datagrid?
Thanks.
Dion
|
|
|
|
|
DataGrid::CurrentRowIndex and myDataGrid::CurrentCell
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
|
|
|
|
|
Hi guys.
This is the problem I encountered. If anybody has any ideas about this, please get back to me. Thanks in advance.
So, I have like 12.000 records in access, and since it is growing fadtla, I upsized it to SQL server. Now, Access provides a native support for OLE bound object, which is not the casew with SQL server. I have Excel and Word files embedded in Access fields, now when I upsized it to SQL server it converts it to Image data type. I know, there is also na option to save a path to the file, and keep file on a disk, but there are security issues related to that so it nees to stay in the dbs.
The problem is when I open ADO stream object, read a binary content from the filed, save it to the disk and opne it, in Excel for instance, it gives me a lot of corrupted data, when some of it is actually displayed correctly. Now it seems as it gets corrupted when upsizing from Access for Access probably does not keep data as it is, i.e. a binary image of the file, but also puts some wrapper around it to support different OLE features and office automation (when you click the OLE bound field in the access, it automatically opens the Word or Excel app and file in it).
So what would be the way for working around this? I can manually open each file in Access and save it to the disk and then upload it from there to SQL server, which will work (I tried it) but there is just to much of it. Is there any way of getting a clear binary stream out of the access or sql server?
Anyways, your ideas are greatly appreciated.
Thanks,
Mirano
.
|
|
|
|
|
You are right. Access uses OleSaveToStream and OleLoadFromStream COM API calls to save/load objects. The CLSID of the stored object is stored prior to object's binary data.
The best solution I may recommend. Don't modify the data transferred from Access. If you are programming in C++ just pass the stream object to OleLoadFromStream function and it will do all job for you. If you are developing under VB, save stream to disk and use GetObject("pathname"), the object will be loaded automatically.
|
|
|
|
|
I am new to database programming and am relatively ineperienced in C++ programming (have done most of my programming in Java). I have searched and searched for tutorials on how to do what I want to do and have had little luck. All I need to do is to read from a .dbf file that contains information about airports. This dbf file is stored locally on this PC and the PC runs Windows 2000. I need to develop a program that I can run on a number of different PC's running Windows 2000, each having it's own locally stored .dbf file. When I research database resources, I see ADO, DAO, ODBC, OLE DB etc... etc... and I cant seem to make any sense of any of it. I was wondering if some of you could help.
1) How should I get started? What class should I use?
2) Do you have any weblinks of some very simple to the point online tutorials that can help me along.
Any help would be appreciated
thanks
Kevin Shaffer
Student of Computer Science
University of Kansas
kshaff03@msn.com
|
|
|
|
|
|