|
Are there any classes or libraries in C# help me to list all available OLE DB providers in my system?
Are there any requirements to do this work?
Thanks for your help.
|
|
|
|
|
Hey everyone,
I have an app which uses an access database for data storage. I access the app using ADO which has all worked fine in the past. Anyway, I just tried to run the app on a WinXP machine but it doesn't work. I can connect to the DB fine but when I do a "SELECT * FROM FILES" I get the following error
CADORecordset Error
Code = 80040e37
Code meaning = IDispatch error #3127
Source = Microsoft OLE DB Provider for ODBC Drivers
Description = [Microsoft][ODBC Microsoft Access Driver]
The Microsoft Jet database engine cannot find the input table or query 'FILES'.
Make sure it exists and that its name is spelled correctly
However, I can open this database from within access OK and I can also get into the FILES table through an ASP page using the same connect string I use in my app.
The WinXP machine is using the latest MDAC (2.7 refresh) and I have updated the JET drivers to sp6.
Anyone have any clues?
Cheers
James
|
|
|
|
|
Does it happen when accessing other tables?
Any chance "FILES" is a keyword in Access?
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)
|
|
|
|
|
Guess, what? It wasn't opening the DB I thought it was. It was opening an earlier version in a different path .
Thanks for the help though.
Cheers
James
|
|
|
|
|
Hi all,
I see that the OLEDBProviderInfos can list all available OLE DB providers. But you must install MS SQL to use Microsoft DTSPackage Object Library.
Are there any other way to do this work?
|
|
|
|
|
I have a problem. A program on a computer issues a query with a date in it to another computer that runs SQL Server. The problem is that the client computer has a different locale than the server computer.
Is there a way to get the SQL server locale from the client so a properly formatted query can be sent.
Tx
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
The simplest answer is to format the date as an ODBC timestamp:
{ts 'yyyy-mm-dd hh:nn:ss'}
|
|
|
|
|
Please, give me some advice.
I need the way to search in the html-documents that are stored as images.
The way to convert an image to text or ntext would also help.
I've tried to use full-text search engine, but it does not work with Russian and Ukrainian texts or maybe I've just configured it wrong
Thank you in advance
Archi
|
|
|
|
|
Hi,
I have to access a SQL database with multiple tables and round about 1.6 million entries. The client is written in C++ and accesses the database through the ADO interface.
At clients' startup I need to read in all existing records using 'SELECT * FROM Table'. I have encountered one problem depending on the operating system the client is running on. On Windows 2000 and Windows XP everything is fine, all the records gets loaded without any error.
However, on Windows NT 4.0 Workstation (Service Pack 6a installed), I get the following ADO error while retrieving the records:
'-2147217915 (0x80040e05) An object was open.'
Since I was not able to find any kind of further information on the internet yet, I would appreciate if anybody could help me out with this - at least explaining the mentioned error description.
Regards,
am_
|
|
|
|
|
You really need to design your db or your client app a bit better.
select * on a table with 1.6 million records is never a good idea.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Well...I do know that. Problem is that I have no influence on the design of the database since it is given by my customer.
Same applies to the design of the client more or less. I have to 'convert' the records for faster lookup therefore I need to do the mentioned query.
Nevertheless that should not raise the described error message. Anyway, thanks for your help.
Regards,
am_
|
|
|
|
|
paste your code if u want more help with that specific error then!
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
The following is an extract of the code I am using:
BSTR g_bstrEmpty = ::SysAllocString(T2OLE(""));
CString DatabasePath("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=test;Data Source=SERVER_NAME");
ADOConnection *pIDBCon = 0;
ADORecordset *pIRecordset = 0;
HRESULT hr = CoCreateInstance(CLSID_CADOConnection,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADOConnection,
static_cast<LPVOID *>(&pIDBCon));
if(SUCCEEDED(hr))
{
BSTR bstrConnection = DatabasePath.AllocSysString();
pIDBCon->put_ConnectionString(bstrConnection);
hr = pIDBCon->Open(g_bstrEmpty, g_bstrEmpty, g_bstrEmpty, -1);
if(SUCCEEDED(hr))
{
hr = pIDBCon->put_CursorLocation(adUseClient);
hr = CoCreateInstance(CLSID_CADORecordset,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADORecordset,
static_cast<LPVOID *>(&pIRecordset));
if(SUCCEEDED(hr))
{
hr = pIRecordset->putref_ActiveConnection(pIDBCon);
VARIANT g_varEmpty;
g_varEmpty.vt = VT_ERROR;
g_varEmpty.scode = DISP_E_PARAMNOTFOUND;
COleVariant varSQL("SELECT * FROM Table");
hr = pIRecordset->Open(varSQL, g_varEmpty, adOpenKeyset, adLockOptimistic, adCmdText);
pIRecordSet->Close();
}
}
pIDBCon->Close();
}
I am using a customer defined wrapper class which just adds another layer to the ADO stuff...the above things are basically what is happening... The 'Open' call on the recordset object fails with the mentioned error.
Edited: Added missing declaration of 'g_varEmpty'
Regards,
am_
|
|
|
|
|
Hi am_
Yes, I am familiar with the ADO way of doing this.
My fault, I should have specified that I am using ADO.NET as you will see from higher up in the thread.
So, I have this problem in the context of ADO.NET
Thanx
Doug
Doug
|
|
|
|
|
Hi there
This should be simple to fix - unfortunately I seem to just be missing something
My ASP page sends through something like 16/09/2002, I recieve it as a varchar. I then need to convert to datetime, and use it with another date to select records for a statement.
I have tried the following:
set @in_start_date = convert(datetime, @in_start_date)
set @in_start_date = convert(datetime, @in_start_date,109)
set @in_start_date = CAST(@in_start_date AS datetime)
All 3 give me a date, but also a message saying:
Server: Msg 242, Level 16, State 3, Line 12
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
Because of the out of range datetime value my stored procedure can't work with the date values & pass the results back to the crystal report.
How do you guys convert varchar dates with "/" separating dd/mm/yyyy to datetime format? Thanks very much
The following statement about your geekness is true. The previous statement about your geekness is not true.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M--
PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++>e+++ h--- r+++
------END GEEK CODE BLOCK------
|
|
|
|
|
Using ASP and SQL mixed gives tonnes of problems with dateformat. Largely becayse america use MM-DD-YYYY and the rest of the world use the more logical DD-MM-YYYY.
I get round the problem by doing the following:-
1. throughout my asp application, I always use the DD-MM-YYYY dateformat.
2. When passing a date to SQL, i send a string from this function:-
Function GetSQLDate ( dtDate)
' check dtDate is a Variant->Date type
If Not IsDate(dtDate) then
Err.Raise vbObjectError + 1024, "Global::Function::GetSQLDate","Argument not a date"
End If
Dim dpYear, dpMonth, dpDay, dpHour, dpMinute, dpSecond
dpYear=Year(CDate(dtDate))
dpMonth=Month(CDate(dtDate))
dpDay=Day(CDate(dtDate))
dpHour=Hour(CDate(dtDate))
dpMinute=Minute(CDate(dtDate))
dpSecond=Second(CDate(dtDate))
if Not Len(dpYear) = 4 then dpYear="20" & dpYear
if Not Len(dpMonth) = 2 then dpMonth = "0" & dpMonth
if Not Len(dpDay) = 2 then dpDay = "0" & dpDay
if Not Len(dpHour) = 2 then dpHour = "0" & dpHour
if Not Len(dpMinute) = 2 then dpMinute = "0" & dpMinute
if Not Len(dpSecond) = 2 then dpSecond = "0" & dpSecond
GetSQLDate=dpYear & "-" & dpMonth & "-" & dpDay & " " & dpHour & ":" & dpMinute & ":" & dpSecond
End Function
This puts the date for sql in an almost foolproof dateformat.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Try:
SET @in_start_date = CONVERT(datetime, @in_start_date, 103)
|
|
|
|
|
I have an app that uses DAO to Access 97 databases that are replicated. Periodically, when the app is shutdown and then restarted I get an error message for "no current record". It gets resolved when the replication is run manually, the replication is deleted and rebuilt, or worse case the replication is deleted and the design master redesignated. Anyone have a clue on how to track this issue down?
|
|
|
|
|
FWIW, I am expriencing a problem similar to the one documented in MS KB Article #Q218751[^], although I am using OleDB classes from within VC++ 6.0.
If I try to call a stored procedure that takes a BLOB parameter as input, and returns an OUTPUT parameter, the output parameter does not get set correctly (in fact, it is not touched at all!) if the length of the BLOB is greater than ~8000 bytes. Manually truncating the BLOB before calling the SP causes the problem to go away. This is with using the MSDASQL driver.
Just a brief warning to those that might be using MDAC 2.7 with OleDB/ADO ...
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
Greeting all,
I'm trying to use on OleDbDataAdapter to read data from an Oracle 8.1 database. Ittermitantly, when I call the fill method, I get an OleDbException that has me stumped. The message is: "Oracle error occured, but error message could not be retrieved from Oracle." The error code is -2147467259.
It seems to be ittermittant: sometimes it happens, no matter what's in the SQL and other times not...
All insight appreciated,
Bill
|
|
|
|
|
I haven't tried but I do know that the original OLE adapter had some problems going against Oracle. Oracle never behaves right with normal code Have you tried the updated Oracle Provider that Microsoft recently released? or perhaps Oracle's own provider? I think it can be found on the Technet site for Oracle.
Mark
|
|
|
|
|
I`m having problems getting data from TEXT field from SQLServer using OLE DB - no data could be fetched.
I`m using DBTYPE_VARIANT and COleVariant.
I work in Visual Studio 6.0.
Can anybody give me any tips or examples for VS C++ and pure OLE DB for SQLServer.
What do I need to do to get data from TEXT field (steps)?
Thank you!
Kind regards... Tau.
|
|
|
|
|
For OleDB , look up BLOB_ENTRY_LENGTH_STATUS in the MSDN help. It works great for me! Although you might want to optimize the given implementation of ISequentialStream ...
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
Is it for TEXT or for IMAGE?
`Cause I can fetch IMAGE without a problem...
But TEXT...
Kind regards... Tau.
|
|
|
|
|
taualex wrote:
Is it for TEXT or for IMAGE?
As the article says, it is for BLOB s (usually IMAGE /LONGBINARY /VARBINARY , etc). However, you may be able to obtain a TEXT field by using the BLOB type and grabbing it from the passed IStorageStream object.
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.4 Now!]
|
|
|
|