|
I've got a stored procedure on an oracle database
PROCEDURE SEABUTTONS_LOAD
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
P_SEABUTTONS_REF REF CURSOR IN/OUT
UNKNOWN RECORD IN/OUT
NENABLED NUMBER(1) IN/OUT
CTEXT VARCHAR2(32) IN/OUT
CADDR VARCHAR2(20) IN/OUT
This procedure should return a recordset. However when I try to use ADO to get the recordset, I get the following error,
ODBC driver does not support the request properties. This seems to happen on the recordset open.
This is the code to open the connection
Set Connection = CreateObject("ADODB.Connection")
Connection.CursorLocation = adUseClient
Dim strConn As String
strConn = "DRIVER={Microsoft ODBC for Oracle}; SERVER=MarsLive; UID=welcomex; PWD=welcomex"
Connection.Open strConn
This is the code that I'm using to access the recordset
Dim strSQL As String
Dim lngRecs As Long
Dim oRS As Recordset
Dim cmdStoredProc As Object
'This code creates a command object.
Set cmdStoredProc = CreateObject("ADODB.Command")
' Connect the database to the command
Set cmdStoredProc.ActiveConnection = objectDatabase.Connection
cmdStoredProc.CommandText = "{call cti.SEABUTTONS_LOAD({resultset 12, P_SEABUTTONS_REF, UNKNOWN,NENABLED,CTEXT,CADDR})}"
cmdStoredProc.CommandType = adCmdText
'This code creates a recordset object.
Set oRS = CreateObject("ADODB.Recordset")
'oRS.CursorType = adOpenStatic
Set oRS.Source = cmdStoredProc
MsgBox "Before Open"
oRS.Open
MsgBox "Before Open"
Any ideas why this doesn't work. I'm afraid Oracle databases are a complete mystery to me. I've never had problems in SQL server. Any code, suggestions, articles would be gratefully received. It doesn't even have to be VB code
This problem has been driving me mad for an age
Thanks in advance
Michael
|
|
|
|
|
I have a question I am running a dual processor Xeon processor running IIS 5.0 and serving pages / info from an Access DB. I havnt run into any problems yet, but here is my question.
Is there a maximum of concurrent users that can query the DB at one time?
Are there any relevant restrictions that using an Access DB over say SQL server that I should be aware of.
Can anyone provide me with information as to the benefits related with running a SQL Server over an access DB?
It seems that when I am page loading from a MAC the server really chugs? any insight? I can use many PC's concurrently, but when I access the website with a MAC its quite a different story.. Any Help / Finger pointing to help would be appreciated.
recurse.org - Recusion For the Rest Of Us.
|
|
|
|
|
MSDN docs say that the max load for a multiuser Access DB is ~50 users. In other newsgroup conversations, I've heard people say ~10 or ~20 users is tops.
http://msdn.microsoft.com/library/techart/apg01.htm
This article points to pros/cons of using MS Access in a client/server scenario.
|
|
|
|
|
I Have a huge problem!
I want to show the records from a database with the following code. Behind the statement Where
should be a code that alows me to do the following:
Select * From 'tablename' Where ' The time is 8 ours later then the current time.'
for example: If there is a record in de column Begin_datum with this value: 06-06-2001 20:00 and the current time is 06-06-2001 12:00, then it must be shown on the homepage. It also has to stay shown until it has been deleted.
Who can make this work! I have done a lot of different codes, but nothing works. Getdate did not work. I hve put the code with this message. I hope that somebody can make it work.
Greetings
<%
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "accessDSN"
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
sqlString = "SELECT * FROM Products Where "
RS.open sqlString
%>
<% Do While Not RS.EOF %>
<%= RS( "Begin_datum" )%>
<%
RS.MoveNext
Loop
RS.Close
%>
JP
|
|
|
|
|
I've found an easy-to-use ActiveX plugin which can convert Excel files into html easily! Many daily data report works becomes much easier since I download it.
By the way, it's called AAA EasyGrid ActiveX.
Available at http://www.share2.com/easygrid/
|
|
|
|
|
Yeah, I've downloaded one and had a try.
thank u for your kind recommendation.
By the way, it seems also great in connecting with all kinds of databases.
|
|
|
|
|
Who can help me with the following:
I have a database with a column Begin_date. When I use the statement Select * From ...... Where Begin_date (hours, -8, GetDATE ) i get a error. The problem is that My ASP server ( PWS in Win98 ) doesn't reconize getDATE. Who can help me with this problem!? Can you give me a working example?
Example:
I want to show all records from the column Begin_date that 8 ours before the date and time is reached. So if I have a record with: 06-05-2001 20:00 then it must be shown on 06-05-2001 12:00
It also have to stay shown until it is deleted. Who now's a asp code that make's this work.
Greeetings from holland,
Jan Pieter
Jan Pieter Elenbaas, Student in Holland.
|
|
|
|
|
I'm not exactly sure what you're asking, but if you're getting dates back from the database and want to display the date, only 8 hours earlier it would look something like this:
Dim datBeginDate
Do Until rs.EOF
datBeginDate = DateAdd("h", -8, rs("Begin_Date"))
Response.Write "Begin Date - 8 Hours: " & datBeginDate & "<BR>"
Loop
You could do all that without the variable, I thought it would be easier to understand with a variable.
If you're having trouble with that code try this code in an ASP page:
Response.Write "Eight hours ago, it was " & DateAdd("h", -8, Now)
|
|
|
|
|
I've found 3 different ways of doing ADO in VC++.
1) The most common way seems to be doing an #import on the ado15.dll
This generates smart pointers to all the objects and off you go.
2) I've also seen used: Import the desired classes from ado15.dll as a typelib,
using the class wizard which generates a truckload of COleDispatch wrapper
classes.
3) Raw COM: Do CoCreateInstance on the interfaces using CLSID's built from the "ADODB.Whatever" type string.
The problem I have with 1) #import is that a class that is both a pointer and not a pointer (-> and .) makes me shudder. I know, it's only overloaded operators, but still....
The REAL problem I have with #import is with _bstr_t. I find that CComBSTR is a much better class if I'm going to also be converting to and from CString's , but the #import smartpointers force me to use _bstr_t's.
The problem I have with 2) COleDispatch generated classes is all those classes I have to have in my project. I get dizzy looking at the class view.
So I decided on method 3). So far I've had good luck with it. The only 'disadvantage' is that I'm responsible for doing all the housecleaning. (This might be a good thing). CComBSTR works great with this approach , and a pointer is a pointer is a pointer (No smartpointer operator goofiness). All the interfaces are defined outside of my project so I don't have to have them in my class view.
Does anyone know any GOTCHA!'s that I might run into using raw COM approach?
(Or perhaps any alternate methods).
Thanks,
Chrys.
|
|
|
|
|
I suggest doing #1, but use the Visual C++ extensions for ADO to avoid the BSTR stuff.
A small sample can be found here: www.gl.umbc.edu/~bcorfm1/software.html
|
|
|
|
|
Hi there,
I was wondering if SQL Server gives it users the option to decrypt an encrypted stored procedure?
If a stored procedure is created with "WITH ENCRYPTION" option, is there anyway, that anyone can open it and view it in text mode?
thanks
|
|
|
|
|
The problem is. I have installed version of MS SQL Server 7.0 - Desktop Edition. And I have to import some data in a new, just created database. So when I try to use the DTS Wizard, at the end of the dialog, appears a protection error message. Something like mms error. What that means. What do I have to do. It's really urgent!!!
|
|
|
|
|
I have developed a application by Visual C++ 6.0, in which I have use ADO and OLE provider to access a database(For example:temp.mdb),some codes as following:
...
_ConnectionPtr pCon;
CString strcnn("Provider=Microsoft.Jet.OleDB.4.0;Data Source=temp.mdb");
pCon->Open(strcnn,"","",NULL);
...
When I do debuging, Application can access Database well, but When I want to
deploy application , I try to intall on Windows 98, While I start application from Start/Program/xxx
application failed to access database (temp.mdb), What can I do?
All suggestion will be welcome, thanks.
contact me at kebinlu@hotmail.com, thanks
|
|
|
|
|
I want to add column in Data Grid control... The DataSource is from ADO.... I can display
all the columns if i did not set the the columns.... If i set the columns i can only set 2
columns.. How to increase the columns so that i can display more than 2 column and format
the columns...
URGENT!!!!!!
THANX!!!!!
|
|
|
|
|
Wouldn't you just write a SQL query to display only the columns that you wanted in your DataGrid? There's no reason to format them yourself; the DataGrid does this for you.
|
|
|
|
|
Hello everybody,
Can we databases of Access or SQL Server programmitically using ADO thru VC++, if we can please give the code snippet.
Thanx in advance
|
|
|
|
|
try to use ADOX object.
you will find solution.
|
|
|
|
|
Hello,
when i import msado15.dll i do not get _RecordsetPtr. I can use _Recordset but i do not know how to get item data. i found in the samples the code but it always uses _RecordsetPtr.
how can i get _RecordsetPtr ? or what is eqivalent usage of _Recordset to the _RecordsetPtr's call:
_RecordsetPtr Rs1;variant = Rs1->Fields->GetItem (_variant_t ("name"))->Value;
thank you
PS I use:
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace rename "EOF", "getEOF");
_COM_SMARTPTR_TYPEDEF(_Recordset, __uuidof(Recordset));
|
|
|
|
|
Well i've been using _RecordsetPtr as a member in header files. I had a quick look at one of my sources and this is everything that I include, so it's probably in one of these.
Good luck, Robert Dickenson.
/*
#include "stdafx.h" // stdafx only includes the following two:
*/
#include <atlbase.h>
#include <atlcom.h>
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
#include <ole2.h>
#include <oledb.h>
#include <icrsint.h>
|
|
|
|
|
...if you'll excuse the topic line ...
what a day- sifted through miles of docs, to still be stuck on this one:
I have a stored procedure sp_ProductRegionalDetails wich takes 2 arguments- @productID and @regionID. This will return a row containing the details of that product, localized (brand etc.) to that region. The thing is, if it does not find an entry for that region, it will search the wider 'parent' region of @regionID, and so-on. Works a treat.
I now need a rowset containing all of the products (their details) in a region. I have a column of distinct ProductIDs and a single RegionID. I need to call sp_ProductRegionDetails with each ProductID and the RegionID, and append the results somehow to the others...
Did I explain my problem..?
thanks for any help
Nick
|
|
|
|
|
yeah baby
|
|
|
|
|
Did you tried to use a temporary table or recursion? I am sorry that I cannot offer you more details since I don't know the specifics, but here is how I'd wrote it:
(1) Recursion. This assumes that your region table cannot find a loop (from a region parent you cannot get back to the same region parent).
Anyway, if this happens, select into a temporary table all the regions you can find starting with a parent, eliminate duplicates and you'll get a table containing the parent region candidates (either our passed ID or an ancestor), and also you can create another temporary table with all the details you need joining the #parents with #products (or @productID, if only a product interests you).
Create Procedure sp_ProductRegionalDetails
@productID int,
@regionID int
As
Declare @lRetVal int
Select @lRetVal = 1
Declare @fExitLoop Bit
Select @fExitLoop = 0
Declare @LoopProductID int
Declare @LoopRegionID int
Select @LoopProductID = @productID, @LoopRegionID = @regionID
While (@fExitLoop = 0)
Begin
Select [... Product regional details ...] From [... Tables, Joins ...] Where
ProductIdField = @LoopProductID And
RegionIdField = @LoopRegionID And
And [... additional conditions, etc ...]
If [The field interesting for me are retrieved]
Begin
Select @fExitLoop = 1
Select @lRetVal = 0
End
Else
Begin
Select @LoopRegionID = Exec sp_ParentRegion @LoopRegionID
If @LoopRegionID Is Null
Begin
Select @fExitLoop = 1
End
End
End
Return @lRetVal
(2) Temporary tables.
Create Procedure sp_ProductRegionalDetails
@productID int,
@regionID int
As
Declare @lRetVal int
Select @lRetVal = 1
[Create a temporary table containing all regions]
-- Create Table #regions (regionID int, ToSelect bit default(0) ) - for example
[Populate this table from our starting point: @regionID - the table will be populated in the natural order, i.e. starts with our regionID, if will find something then return, if not advance to the next parent etc.]
[Eliminate duplicated regionID]
[Query temporary table by joining with @productID]
[Retrieve results and mark in the temporary table ToSelect = 1 where informations you need were found]
[For the first entry in the temporary table with ToSelect = 1 get this row; this is our first row]
[If all the rows in temporary table have ToSelect = 0 --> no results found and return failure]
[If at least one row has ToSelect = 1, return the results associated with this regionID]
Return @lRetVal
If you need all the possible results, I suggest you to create (C++ mode) the temporary table from code, use in sp, read results after sp and drop tabel after. Something like:
VOID GetRegionInfo(DWORD *pdwResultCount, LP_PRODUCTRESULTS *ppResult)
{
CreateTemporaryTable(szTempTableName);
CallSP(szStoredProc, szSPName, pParams);
SelectResultsFromTemporaryTable(pdwResultCount, ppResult);
DropTemporaryTable(szTempTableName);
}
All the best,
Sardaukar
|
|
|
|
|
I'm very new to ADO... The problem I have is I can easily read an Access2000 database, but I can't write to it. I do an AddNew, then update the bound classes memver variables, and then call Update(). As soon as I call update, I get a crash. Please anyone got any ideas why? Here is the code it use...
<br />
_bstr_t strCnn(DSN_CONNECT_STRING);<br />
<br />
HRESULT hr = S_OK;<br />
IADORecordBinding *picRsPatient = NULL;
<br />
try<br />
{<br />
TESTHR(m_pConnection.CreateInstance(__uuidof(Connection)));<br />
m_pConnection->Open(strCnn,"","",adConnectUnspecified);<br />
<br />
TESTHR(m_pRstPatient.CreateInstance(__uuidof(Recordset)));<br />
m_pRstPatient->Open("Patient", <br />
_variant_t((IDispatch *)m_pConnection,true), adOpenKeyset,<br />
adLockOptimistic, adCmdTable);<br />
<br />
TESTHR(m_pRstPatient->QueryInterface(<br />
__uuidof(IADORecordBinding),(LPVOID*)&picRsPatient));<br />
TESTHR(picRsPatient->BindToRecordset(&m_rsPatient));<br />
<br />
}<br />
<br />
catch(_com_error &e)<br />
{<br />
PrintProviderError(m_pConnection);<br />
PrintComError(e);<br />
}<br />
<br />
m_pRstPatient->AddNew();<br />
strcpy(m_rsPatient.m_szPatientName, "James bond");<br />
strcpy(m_rsPatient.m_szPatientNumber, "007");<br />
m_pRstPatient->Update();<br />
<br />
if(m_pRstPatient)<br />
m_pRstPatient->Close();<br />
if(m_pConnection)<br />
m_pConnection->Close();<br />
Thanks
|
|
|
|
|
Cant Point out Exactly what the error is.I Had a similar error.
Check If the Database has any constraints in it(foreign etc).
Also check if recordset parameters are supported by the database.
|
|
|
|
|
I found what is was. The database was empty - it had no records in it at all. Supposedly you need a dummy record for it to work
|
|
|
|
|