|
my program should be in c++..
what had namespace to do with it???
what is that ADODB that you have mentioned in oyur program??
and what all includes you have asked me to skip??
ranjani
|
|
|
|
|
If you remove the following includes
<br />
#include "adoid.h"
#include "adoint.h"
and instead use
<br />
#import <X> rename("EOF", "AdoEOF");<br />
you will get all the smartpointers and methodwrappers for ADO.
(Replace the X with the name of the dll/tlb you want to use, i.e. msado15.dll, msado25.tlb and so on,
to see which versions you have installed, have a look at C:\Program Files\Common Files\System\ado)
This is normally imported into the namespace ADODB i.e. ADODB::Connection15Ptr.
To get rid of the namespace, use no_namespace when importing.
|
|
|
|
|
I need someone to fully explain the way to download my sql since I tried and unzipped but probably d-led the wrong one.. Need someone to make a walkthrough with steps starting at mysql.com to the exe. If you would like, you could just e-mail me at snyp_@hotmail.com.
Thankyou,
I would appreciate it and help me develop my sql skills...;P
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
MySQL under Win32 is a little weird and takes after it's Unix heritage quite a bit, so I can understand the confusion.
Here are the basic steps to get started:
- Get the Win32 installer from: http://www.mysql.com/downloads/mysql-4.0.html[^]. The download is a zip file; just unzip the contents into a new directory.
- Run
setup.exe from the unzipped directory. I just accepted the default install path of C:\mysql and used the "Typical" install. - After the installation, you should have a
C:\mysql\bin directory with all the programs associated with MySQL. The easiest way to get started is just to run the winmysqladmin tool. - Right after starting,
winmysqladmin will ask you to create a new user, then will launch the main interface, which will promptly minimize itself to the system tray (!!). To show the interface again, right-click on the icon and select "Show Me". - When WinMySQLAdmin is started, it will automatically start up the MySQL service. You can stop and start the service from the WinMySQLAdmin system tray icon.
- Once the service is started, you can work with the database using
mysql.exe and mysqladmin.exe , which are command-line tools that act just like their Unix counterparts. mysqladmin.exe is used for creating and dropping (deleting) databases, changing passwords, and doing other interesting things to the server. mysql.exe provides a console interface for executing SQL commands.
On install, MySQL provides an empty database called test which you can use as a sandbox for trying out things. To switch to using this database, run mysql.exe (the initial install has no root password, so it should just connect and run) and type use test at the console. Now you're ready to start learning SQL
- Mike
|
|
|
|
|
|
Hi,
I have created a framework in c# which provides a main window with a connection to the database. This window can house various plugins which need to use the database connection, so a 'get' property is provided which returns the SqlConnection.
I would like to avoid the situation where someone can write a plugin which wil close the database connection, thereby preventing the other plugins from using it. It is not expected to be a security feature, more of a convienience to make the system more robust by preventing developers accidently closing the connection.
I do not seem to ba able to specify that the property (or a method for that matter) should return a 'const' method. This doesn't work:
public const SqlConnection Connection
{
get
{
return sqlConnection;
}
}
Any ideas?
David
|
|
|
|
|
I'm not familiar with C#.
This is more of a C# question; why don't you ask on the C# forum[^]?
My feeling is that it's likely to be readonly rather than const , but don't quote me on that.
|
|
|
|
|
Dear All,
Does everyone try to implement application support Unicode. This application use C# and connect Sybase 8.02 via OLE DB Provider for Sybase? If yes, please help me to solve it. The problem is I can not retrieve Unicode data as I entered. It always returns empty string.
Thanks and regards.
|
|
|
|
|
How can I check if a field (for example 'Oldy') exist?
I'm using A set of ADO Classes - version 2.10, but there is no function like GetFieldName(UNIT nIndex). Can any1 help me please?
Love is the law, love under will.
|
|
|
|
|
Recordset.Fields("Oldy") returns a Field object if it exists
|
|
|
|
|
Ok. And how can i get a field name by the index? I would need a function like GetFieldName(UNIT nIndex).
Please help
Love is the law, love under will.
|
|
|
|
|
I use this to grab field names from an ADO recordset for a listctrl:
FieldPtr pFld = NULL;
if(m_pRecordset != NULL ) {
if(m_pRecordset->State == adStateOpen) {
long count = m_pRecordset->Fields->GetCount();
for(long i = 0; i < count; ++i) {
pFld = m_pRecordset->Fields->GetItem(i);
m_DataListCtrl.InsertColumn(i,pFld->Name,LVCFMT_LEFT,100);
In short, the Name is a property of the field item.
|
|
|
|
|
Hi All,
I want to connect to Access Database. I am using Visual Studio.NET beta version. In that I want to use the class System.Data.ADO.ADODataSetCommand. But, when I use this in my code i am getting compile time error as
"the type or namespace name 'ADO' does not exists in the class or namespace 'System.Data' are you missing an Assembly reference.". In my 'References' 'System.Data' is present.
Can anybody tell me what specific assembly reference should I add to get 'ADO' namespace inside 'Data' namespace.
Thanks in advance.
regards,
Pranoti
|
|
|
|
|
I spent most of yesterday being frustrated by ORACLE. Using the ORACLE provided OLE DB driver, I call a stored procedure which doesn't return a recordset. This is done with a parameterised command "{CALL procname(?,?,?)}". So far, so good.
However, if one of the parameters is a BLOB, I have problems. The parameter is an IN BLOB, and I pass it out as an ISequentialStream. Now either it doesn't use the parameter (and it's treated as if I passed in NULL), or it fails with a parameter mismatch. Now you might think that this is all my own fault, but exactly the same code works with a SQL Server SP which takes an IMAGE parameter.
Anyone any ideas on how to resolve this?
Steve S
|
|
|
|
|
i need to connect to a database(independent of whatever databse it is)
from my C++ program..
it should be done with ADO..
how do i do it?
what are the ADO functions to do this job?
ranjani
|
|
|
|
|
Hi,
Mmmm... Here you have the connection string formats for each type of database using ADO:
ConnectionStrings
you can use ODBC on ADO as well. Good Luck
Braulio
|
|
|
|
|
hey guys, sort of a general-ish implementation question here:
in this project i'm working on, i have a MFC/ADO program working with MS Access databases for an art firm. being an art firm, the database works with images, and i somehow need to embed those images into the database. so far i have a field with an "OLE Object" type, because that was how the firm has done it in the past (insert the image as an ole object). to me it sounds ideal because then i can insert and view the thumbnail associated with the entry a lot easier than if it was stored externally in a file, and it'd be much easier to move the database around. however, i cant seem to figure out how to interact with OLE Object types.
can anyone point me in the general direction of how i can insert images and extract and view them if they're stored as an OLE Object in an access db? or is the idea bogus and there's an easier implementation that my feeble mind hasn't thought of
thanks for any help guys!
|
|
|
|
|
Quick tip:
Store the images in the filesystem instead. A shared folder on the workstation with the database itself will do fine. You will kill the database otherwise (not to mention that OLEObjects in Access is a real pain in the XXX to work with...).
|
|
|
|
|
How do I create a datatable based on few columns from a datatable which contains n number of columns
For eg.,
I have a Datatable inside a dataset which contains following
columns say 'A', 'B', 'C', 'D' (the order of column may vary from difft source)
I need to send a datatable to function which requires only 'B' and 'D'. Based on this column, I use SqlDataadapter for update to the database.
This adapter requires ordering of the columns. That is the reason I am creating required table and sending it to the function.
For eg.,
l_sqlString = "SELECT SEGMENT_ID,MEMBER_ID,EMAIL_GRP_ID FROM EM_PROMO_GRP_MEM WHERE EMAIL_GRP_ID = 7";
SqlConnection l_objSqlConn = new SqlConnection(DAOConfigDataUtil.GetConnectionString(DatabaseType.SQL));
sAdapter = new SqlDataAdapter(l_sqlString,l_objSqlConn);
If I am right DataView can be used only to view particular columns from a datatable.
Please help me out.
|
|
|
|
|
I am new to DB programming in VC.
Any Idea why this SQL statement will not return any results in my program:
SELECT *
FROM Table
WHERE Field1 LIKE "*text*" AND Field2 LIKE "*txt*";
The query runs fine in Access 2002 but will not return any results in my VC app.
"Microsoft.Jet.OLEDB.4.0" is my provider when connecting to the Acesss DB. I tried to use "Microsoft Access Driver" but that throws an exception because it can not be found(???).
Thanks for any suggestions.
Matt (Padawan Learner)
|
|
|
|
|
|
Hello all
I'm connecting to sqlserver using ADO and trying to execute a stored procedure. I'm getting an error like "invalid char value for cast specification error". I've the following code to execute the stored procedure.
setproc(int devid,char *cfgid,char *lmsgid)
{
try{
m_Command.CreateInstance(__uuidof(Command));
//using already created connection object
m_Command->ActiveConnection = m_Connection;
m_Command->CommandType = adCmdStoredProc;
m_Command->CommandText = "usp_IsIDExist";
_ParameterPtr pParam1, pParam2,pParam3;
pParam1=m_Command->CreateParameter(bstr_t ("DevID"), adTinyInt,adParamInput,sizeof (BYTE),_variant_t (long(devid)));
m_Command->Parameters->Append(pParam1);
pParam2=m_Command->CreateParameter(bstr_t ("CfgID"), adVarChar,adParamInput,1,(_bstr_t)cfgid);
m_Command->Parameters->Append(pParam2);
pParam3=m_Command->CreateParameter(bstr_t ("LastMsgID"), adVarChar,adParamInput,strlen(lmsgid),(_bstr_t)lmsgid);
m_Command->Parameters->Append(pParam3);
m_Recordset = m_Command->Execute( &vNull, &vNull, adCmdStoredProc);
}catch(com_error &e){}
}
I've the following strored procedure .....
CREATE PROCEDURE usp_IsIDExist
@DevID integer,
@CfgID char(1),
@MsgID varchar(255)
AS
BEGIN
IF (SELECT COUNT(*) FROM dbo.MsgLog WHERE DevID = @DevID AND CfgID = @CfgID AND MsgID = @MsgID) <> 0
SELECT Result = 1
ELSE
SELECT Result = 0
END
in msglog table devid -- int,cfgid -- char(1) and msgid -- varchar(255).
Is there anything wrong this code. I tried it on two machines, on one machine it worked where on another machine if failed giving me the above mentioned error. Both machines have the same database setup except the fact that one is win2000 server and another one is win2000 prof.
Can anyone help me in this?
Many thanks for your help.
Hari.
|
|
|
|
|
Dear Friends,
Consider the table:
id country
=== =======
1 Australia
2 Burma
3 Canada
4 USA
I've an input string:
set @input = 'I live in Australia'
Now i need to find out that is there any substring of my input string present in the 'country' column of above table.
example, in my sample string: "I live in Australia ", the substring 'Australia ' is present in the table above. Thats what i like to know. So how can i make such SQL query ??
|
|
|
|
|
|
I would assume you are using a stored procedure? The key elements in a query like this are the LIKE keyword and a % sign on both sides of your search variable. Something like the following should do it for you:
SELECT id, country FROM [YourTable] WHERE country LIKE '%' + input + '%'
HTH
-Nick Parker
|
|
|
|