|
This ADO article uses ADO Events
http://www.codeproject.com/database/isqlado.asp
You might want to look at this to get a few ideas.
|
|
|
|
|
(C++!)I tryed to insert some data into Excel table with use of Excel type librarys and figured out it is slow as hell. Then i tryed to find out some
other solution and started to play with ODBC. I opened ADOX::_CatalogPtr to Excel file and tryed to insert new table; it didnt work! Then i have tryed some other methods like SQL (CREATE TABLE...) on that connection and everything failed! Same happened when i tryed to create new column in same table with ->Append(...) and SQL method and allso both failed. Same was with inserting data into existing column...
Anyone knows how to insert some data there trough ODBC???
|
|
|
|
|
Hi all.
Does anyone ever encounter a skipping recordset in DTS via active-x script?
My situation is like this, I am running a dts process which uses a recordset to retrieve each record in a table (using recordset object), then pass some of the values into a ADO command object to execute a stored procedure with the parameters from the record that I retrieved. I keep doing this until the recordset hits EOF. If the process is successful, I would delete the record via adoRec.Delete 1 (adoRec is my record set object) then do adoRec.Update. Then I do a move next to retrieve the next record in the table. However, sometimes the record set does not go through each record in the table but it skips some records. The problem would gone after I restart the SQL server (version 7).
Anyone know what is the cause and solution for this problem?
|
|
|
|
|
(Beginner to SQL/MSSQL).
I have created some SQL scripts (e.g. for repopulating tables for test), and saved them to external file (e.g. repopulating tables). I want to get SQL server to execute the scripts. I do *not* want to use an interactive utility (e.g. Query Analyzer, though that's where I generated and saved the scripts), nor a command-line utility (e.g. osql, though it does precisely what I'm trying to do). I do not want to store them as stored procs in a db. I want to do it from code (actually C# & ASP.NET application, though that shouldn't matter).
The files are accessible to the SQL server. What I want is a SQL statement like:
EXEC <file-path>
but I can't find anything like this. Yes, I could write code to open the file and append all the text to a string I finally submit to an ExecuteNonQuery(), but this seems brain-damaged to me (is this in fact what osql does?).
*Surely* there's something for this?
TIA
|
|
|
|
|
Does anybody have experience in updating dBase files using ADO. In my simple project I allways receive an error telling me that I do not have the right to update while using pRecordSet->UpdateBatch(adAffectAll).
Thanks
|
|
|
|
|
Update MDAC and you can update dBase files.
|
|
|
|
|
Hi,
I just read in MSDN Library at the MS site that MS have deprecated the Jet engine:
(from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/mdac_deprecated_components.asp):
"Jet and Replication Objects (JRO)
The Microsoft Jet OLE DB Provider and other related components were removed from MDAC 2.6. Microsoft has deprecated the Microsoft Jet Engine, and plans no new releases or service packs for this component. As a result, the Jet and Replication Objects (JRO) is being deprecated in this release and will not be available in any future MDAC releases."
This is the only place on the MS site where I can find any mentioning of MS dropping the Jet Engine. As I'm currently developing an application based on Jet I'd really like to hear if anybody has any information?
If Jet is dropped I guess I'll have to go for another (free) engine. There is of course MSDE, but is it the 2000-version free as the 1.0 version was? (Provided you have VC++6.0 Enterprise)? Another possibility could be MySQL which has an OLEDB provider, does anybody have any experiences with the db or the provider?
thanks in advance
Steen.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
I dont understand why i cant type (local) to get access to my local MSDE server.
I think ther are some problem with the insallation of the MSDE server.
Working
(L"Provider=SQLOLEDB.1; Data Source=M02WS-17-051;Initial Catalog=TEMC_MEASSQL;uid=sa");
Not working
(L"Provider=SQLOLEDB.1; Data Source=(local);Initial Catalog=TEMC_MEASSQL;uid=sa");
Someone who have an ide?
|
|
|
|
|
|
Use the DataLink Dialog to open a connection using(local) as the server on a working system (not MSDE), then get the connection string and compare this against your connection string.
|
|
|
|
|
The current project I'm working we are using SQL Server as our database server. I have not used SQL much and wanted to know of any good resources are books that you guys recommend. I would be more interested in a reference type book then a step-by-step book. Thanks for any suggestions!
Joshua
|
|
|
|
|
Netmeisters,
I am trying to use OLEDB and SQL Server CE, under Windows CE, to access a table which contains some NTEXT columns. I have created bindings which should return both the value and length of each field. However, the obLength address contains rubbish for the NTEXT fields. For all the other fields it works fine. Is there an explanation and fix for this problem?
Thanks very much.
Matthew Fleming
mgf@mcw.edu
|
|
|
|
|
Can anyone please help with a problem I have. I'm trying to use ADO code within an Access database to retrieve certain records from a table. when the code runs, it tells me that the database has been placed in state by user X that prevents it from being locked or edited. Do I have to open the current database I'm working on from code before I can use recordsets? Can anyone provide sample code to retrieve some data from table test? Thanks in advance
|
|
|
|
|
I have a COM method that returns a db connection pointer, as defined below
GetDBConnection(_Connection **pdbReturnValue)
{
.
.
.
*pdbReturnValue = m_pConnection.Detach();
return S_OK;
}
And my two test client are defined as follow
VB
Dim pMyInterface As New MyInterface
Dim pConn As New ADODB.Connection
Set pConn = pMyInterface.GetDBConnection
pConn->Execute "select * from rt_user", NULL, adCmdText
Set pConn = Nothing
Set pMyInterface = Nothing
----------------------------------------------------------------------------------
VC
CoInitialize(NULL);
HRESULT hResult;
CComPtr<imyinterface> pIMyInterface;
_ConnectionPtr pConnection;
hResult = pIMyInterface.CoCreateInstance(CLSID_MyInterface,
NULL, CLSCTX_LOCAL_SERVER);
pConnection = pIMyInterface->GetRealTimeDBConnection();
pConnection->Execute("select * from rt_user", NULL, adCmdText);
pConnection->Close();
pIMyInterface.Release();
CoUninitialize();
The problem occurs when trying execute the sql command in VC client.
The error message received is -> "A null reference pointer was passed to the stub"
This works without a hitch in VB. What am I doing wrong? or have left out? I
understand that VB does alot of the marshalling in the back end. In this case,
what would be the equivalent marshalling technique? Thanks in advance for
your help.
P.S. The component is running under Component Service Manager as a Server.
AliBaba
|
|
|
|
|
use queryinterface to return the connectionptr
e.g.
m_pConnection->QueryInterface(__uuidof(_Command),(void **)pdbReturnValue);
instead of
*pdbReturnValue = m_pConnection.Detach();
in your
GetDBConnection com method
|
|
|
|
|
I have tried that also, but it didn't solve the problem.
I have also tried
CComPtr<_Connection> m_pConnection;
.
.
.
m_pConnection.CopyTo(*pdbReturnValue);
but it also failed to return the correct connection pointer.
|
|
|
|
|
Contrary to the (hallowed) Bill Vaughn's article in SQL server mag for April 2001 and elsewhere I'm finding that it doesn't matter what you call the stored procedure Return Value parameter.
Is anyone else find the same?
eternal student
Give a man a fish and you feed him for a day; teach him to use the 'net and he won't bother you for weeks.
|
|
|
|
|
Hi all,
For creating database and table and field i must know SQL+ ?
Not any other way ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Use the Schema manger provided with the client software,
its called 'DBA Studio'.
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
use the free version of toad (oracle equivalent to Enterprise Manager) from www.toadsoft.com
Top Oracle tool
|
|
|
|
|
Attempting to connect to a Sybase backend using C#, OLE and ADO.NET. Using VC#.NET I can make the data connection using OLE DB Provider for ODBC (MSDASQL) but I get a 'System.NotSupportedException' when using MSDASQL.1 as the Provider when opening a connection. MSDN help states that "Support for the OLE DB Provider for ODBC (MSDASQL) is disabled."
Does anyone have any ideas on how to circumvent this?
Thanks
|
|
|
|
|
I am trying to do the following !
Open one session of Query Analyser Window
Begin Trans
Update Table1 Set ...
But I don't commit !
Open another session of Query Analyser Window
Select from Table1
Select gets Blocked unless Update is committed !
CAN'T I DO A SELECT WHEN UPDATES/INSERTS Occur ?
I Can do with NOLOCK but we don't want uncommitted data to appear !
I have tried with all transaction isolation levels.
Anyone can help ?
Thanks
Anand
|
|
|
|
|
Hi
When i use the function CRecordSet::Update, i have an exception.
Besides, when i use the function Crecordset::MoveFirst, I don't read the first record.
Anyone can help me please.
I send you my code.
Thanks
try
{
/* APP->m_TmSet -> Open ();*/
CTmSet tmset;
if (tmset.IsOpen () ) tmset.Close () ;
tmset.Open();
MessageBox(NULL,"passe","passe3",MB_OK);
//if ( APP->m_TmSet -> CanAppend () )
if (tmset.CanAppend () )
{
MessageBox(NULL,"avant new","passe",MB_OK);
//tmset.AddNew();
tmset.MoveFirst();
tmset.Requery () ;
//tmset.Edit();
for (int n=0;n<20;n++)
{
char buf[10];
MessageBox(NULL,tmset.m_TM_NAME,"nom",MB_OK);
wsprintf(buf,"%ld",tmset.m_TM_ID);
MessageBox(NULL,buf,"id",MB_OK);
tmset.MoveNext();
}
int a=tmset.GetRecordCount();
wsprintf(buf,"%ld",a);
MessageBox(NULL,buf,"nb record",MB_OK);
/*tmset.m_BAY_CODE =TmSql->numBay ;
tmset.m_TM_ID =TmSql->numTm ;
tmset. m_TM_NAME=TmSql->libTm ;
tmset.m_TM_UNIT =TmSql->libUnit;
tmset.m_TM_ARCHIVE =TmSql->FlgArchive ;
tmset.m_TM_STATE_CURRENT =0;
tmset.m_TM_DATE_CURRENT =0 ;
tmset.m_TM_DATE_OK_CURRENT=0 ;*/
tmset.m_BAY_CODE =0 ;
tmset.m_TM_ID =0 ;
tmset. m_TM_NAME="a" ;
tmset.m_TM_UNIT ="b";
tmset.m_TM_ARCHIVE =0 ;
tmset.m_TM_STATE_CURRENT =0;
tmset.m_TM_DATE_CURRENT =0 ;
tmset.m_TM_DATE_OK_CURRENT=0 ;
if (tmset.CanUpdate () !=0)
{
MessageBox(NULL,"avant Update ","passe",MB_OK);
tmset.Update();
MessageBox(NULL,"après Update","passe",MB_OK);
}
if ( tmset.IsEOF ()!=0 )
tmset.MoveLast ();
tmset.Requery () ;
tmset.MoveLast () ;
MessageBox(NULL,"ajoute3","passe",MB_OK);
// UpdateData ( FALSE ) ;
}
else
AfxMessageBox ( "Can Not Append a Record" ) ;
}
catch( CDBException* e )
{
AfxMessageBox( e->m_nRetCode,
MB_ICONEXCLAMATION );
// Delete the incomplete recordset object
/* delete m_pSet;
m_pSet = NULL;*/
e->Delete();
}
|
|
|
|
|
You need to call AddNew or Edit Methods before you call Update. Your code currently has them commented out.
|
|
|
|
|
Hi,
I'm trying to synchronize a client side Access database with a backend SQL server database. I've combed through the MSDN and all I can find if Replication. Does anyone know if it's possible to synchronize an Access database with SQL Server?
Any help would be greatly appreciated.
Thanks,
Craig
|
|
|
|