|
Well, both ASP and PCAnywhere could be good solutions.
If you use PCAnywhere you need to write your application in access, because all the users would be using remote control of your server.
With ASP you need to write the application using Active Server Pages, so I guess it depends on what you know most about.
If security is a great consern for you, and the users access the app. using the internet, I would go for ASP, maybe using a SSL connection to encrypt the pages.
If a hacker hacks your webserver he have a harder job taking over your server, than if he hacks a server running PCAnywhere...
- Anders
|
|
|
|
|
Hi all,
I'm using ADO for accessing a MS Access database file in a DLL. I then use this DLL in my application. The problem happens when I try to start any NT service (for ex, IIS Admin Service) and my application at the same time: my application seems to hang forever. I put some debug logging and find out that it get stuck in a function _RecordsetPtr->Open(...), I then try to use _ConnectionPtr instead, it also get stuck in _ConnectionPtr->Open(...). I am very confused and I don't know what's going on. Have anyone encountered this problem before? Please help.
Thank a lot,
Rocky
|
|
|
|
|
Visual C++ 6.0, sp5
NT4, sp5
I'm working on an app that uses ADO to access an oracle database. The following code is part of the function that opens a recordset (try/catch stuff removed for the sake of brevity):
Fields* m_pFields = NULL;
SAFE_CALL(m_piRecordSet->Open(vSQL, vConnection, adOpenDynamic, adLockOptimistic, adCmdText));
int m_nRecordCount = m_piRecordSet->GetRecordCount();
SAFE_CALL(m_piRecordSet->get_Fields(&m_pFields));
...and this is a code snippet from the function we use to close the recordset:
if (m_pFields)
{
m_pFields->Release();
}
SAFE_CALL(m_piRecordSet->Close());
m_piRecordSet.Release();
m_piRecordSet = NULL;
The problem is with the m_pFields variable.
The first 10 or so times we call the function containing this code, it's a valid pointer. On or about the nth time, the variable is NULL. Actually "not initialized" would be a better description of it's state, because if we don't set it to NULL before calling the get_Fields() function, it's value is 0xcccccccc.
As far as I can tell, we close the recordset when we're done with it. Otherwise, we'd get an error message from Oracle saying we have too many open cursors.
Has anyone got any idea why this might be happening?
|
|
|
|
|
Hi,
I use Visual C++ 6.0 SP 4 , SQL Server and oledb
I create a class to connect to my database. In my constructor i initialize com library like this :
CoInitialize(NULL);
In my destructor i release com library like this :
CoUninitialize();
If i use this class to execute for exemple an sql query ( store procedure), my functions open, execute, close,... work.
But if i close my application ( OnOK ) , two seconds later i obtain the following acces violation message :
EXCEPTION(c0000005 acces,@40f919) EBP184f0b8 EIP40f919)
ASM 45 fc 8b 08 8b 01 52 ff 50 08 8b e5 5d c3 cc cc cc cc cc cc
EAX:184f618 EBX:dc0110 ECX:383439 EDX:383439 ESI:dc0064 EDI:184f664 ESP:184f0b4
The suspect function is _Release() throw() which is in a Visual C++ include file ( in Include\COMIP.H )
// Releases only if the interface is not null.
// The interface is not set to NULL.
void _Release() throw()
{
if (m_pInterface != NULL) {
m_pInterface->Release();
}
}
But if i comment out CoUninitialize() instruction, my code work without acces violation.
Can anybody help me?
Best regards,
Cheickna
|
|
|
|
|
Yeah, I think, the problem is the following: when you call a destructor, the code within the destructor is executed, then the destructors of the base classes (reverse order of constructors). So when a base class calls Release or any COM function, the Com Library is not available any more and the code GPFs.
I solved the problem like this:
struct ComStarter {
ComStarter() { CoInitialize(NULL); }
~ComStarter() { CoUninitialize(); CoFreeUnusedLibraries(); }
}
class MyConnection: public ComStarter, public _ConnectionPtr /*or whatever*/
{
// here your code
~MyConnection() { ... }
};
This guarantees that CoInitialize() is called as the very first, and CoUnitialize() as the very last function.
|
|
|
|
|
I have had this symptom before, and my problem was that I had amulti-thread app and I didn't Always marry the CoInit with the CoUninit.
I had two solutions, make sure every thread calls Coinit and CoUninit correctly
(as I had a bug) and use CoInitializeEx(Multithread)!
This my be a different problem to yours, but then again it may not!
Jules.
|
|
|
|
|
Hi
I need to upload binary file (dll) to SQL Server database throught ADO.
I tried to use "ADODB.Stream" object, but i can't open this stream from the file.
hVecoStream->Open(n, adModeUnknown, adOpenStreamUnspecified, _bstr_t(""), _bstr_t(""));
hVecoStream->LoadFromFile(szFileName);
Could you specify correct syntax for this method call
Thanx.
|
|
|
|
|
Have you tried ASP.Upload. Got to aspupload.com
|
|
|
|
|
|
if any body can please help me out, i have to replicate the data of client site to server now the problem is which method should i addopt and which one will be the best in what circumstances, If i use any of the following way.
1.text format
2.Recordset(ADO)
3.XML
or what will be the benifit and disadvantage of any of these method.
Is there any othere method also to transfer the data to remote site???
please answer either on board or on bin_omair@usa.net
Thanx
Efan
|
|
|
|
|
Well, if both the databases are SQL-Servers I would use the Data Transfer or the Replication in SQL Server.
To get a better answer, you'll need to be more specific, in what it is you want...
- Anders
|
|
|
|
|
if any body can please help me out, i have to replicate the data of client site to server now the problem is which method should i addopt and which one will be the best in what circumstances, If i use any of the following way.
1.text format
2.Recordset(ADO)
3.XML
or what will be the benifit and disadvantage of any of these method.
Is there any othere method also to transfer the data to remote site???
please answer either on board or on bin_omair@usa.net
Thanx
Efan
|
|
|
|
|
Does anybody know how to get data stored into VARCHAR data field of Interbase using ADO and Visual C++?
Mukhit
|
|
|
|
|
I'm having major problems using nested outer joins with
SQL Server 6.5 and ODBC.
I'm following the documentation to the letter but I'm getting
the error "The column prefix '' does not match with
a table name of alias used in the query"
I do not get errors when using Oracle.
Does anyone have an example of nested outer joins?
Many thanks.
|
|
|
|
|
I think they had limits on the nesting. What does the Oracle query look like?
Bob Zagars
|
|
|
|
|
I am running a large links database at http://www.scoutinglinks.com so record paging is a must.
My problem is that many of my users are still using Netscape 4.x. These user can view the first page with out problems, if they select a link the next page they receive "the parameter is incorrect" error message. I have confirmed the error through testing, the reports are accurate.
I have rewritten the function numerous times, the last method I found here at The Code Project "http://www.codeproject.com/asp/rspaging.asp" with the same result.
If anyone has ever experienced this and found a solution your suggestions would be appreciated. I have asked these users to upgrade to Netscape v 6, but we all know how that goes. I have also tried finding a Java solution but really don't want to rewrite the whole app.
Again, any help would be appreciated.
Regards
Bert
|
|
|
|
|
Kind all,
I built this MTS object that runs a SP and should be able to returns to the user:
'1) (if existing) the Rs(s) found for the wanted DB table(s);
'2) the adParamOutput, adParamReturnValue ADODB.Parameters
from the SP.
When I run the component the following things happen:
* the adParamOutput and the adParamReturnValue ARE EMPTY
(note that I forced the SP to return in any case a Return value and a value as output paramter).
** when I loop the array that should comntain all the RS(s) contained in a specific DB field, I get
the usual "Subscript out of range".
I poste my code: both the code (DBObj.cls) for the DB object and the code (.frm) I used x testing it.
The name of the DLL project is: OggettoDB.
-----------------START OF THE DB OBJ (DBObj.cls)----------
Option Explicit
Implements ObjectControl
Dim ctxObject As ObjectContext
'******************************************************************************************
'this function should returns:
'1) all the Rs found for the wanted DB table fields: Id(), Datacurr(), TipoRep() and path()
'are the arrays that should contain the found Rs(s) for the 4 choiched DB fields;
'all these are passed byref
'2) the adParamReturnValue parameter: I choiched here that the return value from the
'SP be the return value of this function
'3) the adParamOutput: is the outparam passed byref too.
'4) currdata is the adParamInput
'*******************************************************************************************
Public Function RunAnySP(Id() As Variant, Datacurr() As Variant, TipoRep() As Variant, _
path() As Variant, outparam As Variant, ByVal currdata As Variant) As Variant
'ho scelto che il valore di ritorno della funzione sia il valore di ritorno dalla SP
Dim Cn As ADODB.Connection, Rs As ADODB.Recordset
Dim Cmd As ADODB.Command
Dim Param1 As ADODB.Parameter, Param2 As ADODB.Parameter, Param3 As ADODB.Parameter
On Error GoTo ErrorHandler
Dim cnstring As String
cnstring = "Provider=SQLOLEDB.1;Initial Catalog=Finanza;Data Source=direct-comflcg;"
Cn.Open cnstring
Set Cmd.ActiveConnection = Cn
Cmd.CommandText = "myProc"
Cmd.CommandType = adCmdStoredProc
Set Param1 = Cmd.CreateParameter("paramimput", adDate, adParamInput, currdata)
Cmd.Parameters.Append Param1
Set Param2 = Cmd.CreateParameter("parametroutput", adInteger, adParamOutput)
Cmd.Parameters.Append Param2
Set Param3 = Cmd.CreateParameter("valoreritorno", adInteger, adParamReturnValue)
Cmd.Parameters.Append Param3
Set Rs = Cmd.Execute
'Dim recordsAff As Long
'Cmd.Execute recordsAff
'If recordsAff = 0 Then MsgBox "Nessun record trovato/inserito!"
'here I fill the 4 array (corresponding to the 4 choiched DB fields) with the data found in the DB
Dim contatore As Variant
contatore = 0
While Not Rs.EOF
Id(contatore) = Rs.Fields(0)
Datacurr(contatore) = Rs.Fields(1)
TipoRep(contatore) = Rs.Fields(2)
path(contatore) = Rs.Fields(3)
contatore = contatore + 1
Rs.MoveNext
Wend
Rs.Close
'After having close the Rs I assign its value to the parameter n 1: as I said, this is the outparam
outparam = Cmd.Parameters(1)
'as I already said, the return value of the function is the adParamReturnValue
Set RunAnySP = Param3
Cn.Close
Set Cn = Nothing
Set Rs = Nothing
Set Cmd = Nothing
ctxObject.SetComplete
Exit Function
ErrorHandler:
If Not Cmd Is Nothing Then
Set Cmd = Nothing
End If
If Not Rs Is Nothing Then
Set Rs = Nothing
End If
If Not Cmd Is Nothing Then
Set Cmd = Nothing
End If
ctxObject.SetAbort
End Function
Private Sub ObjectControl_Activate()
Set ctxObject = GetObjectContext()
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False
End Function
Private Sub ObjectControl_Deactivate()
Set ctxObject = Nothing
End Sub
----------------START OF CODE X THE .FRM MODULE-----------
Option Explicit
Option Base 1
Private Sub Form_Load()
Dim OggettoDB As OggettoDB.DBObj
Dim id() As Variant
Dim Data() As Variant
Dim Tipo() As Variant
Dim Path() As Variant
Dim out As Variant
Dim myvar As Variant
Dim parainput As Variant
parainput = "1/16/2001"
Set OggettoDB = CreateObject("OggettoDb.DBObj")
myvar = OggettoDB.RunAnySP(id(), Data(), Tipo(), Path(), out, parainput)
'myvar is the return value
MsgBox myvar 'the value is empty
MsgBox out 'the value is empty too
Dim x As Integer
For x = 0 To UBound(Data) 'when I start this cycle I get out of range error
MsgBox Data(x)
Next x
End Sub
Private Sub ObjectControl_Activate()
Set ctxObject = GetObjectContext()
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False
End Function
Private Sub ObjectControl_Deactivate()
Set ctxObject = Nothing
End Sub
|
|
|
|
|
I am trying to append record to the newly created Database(which is created thro' DAO ) thro' program . But, i am unable to add the first record(thro' ADO).But if I add the first record manually(directly into the DB)the following records are getting appended thro' program perfectly.
How can I append the first record thro' the program .
Y.Yamini Devi
|
|
|
|
|
i to have the same problem as you. so if you find a solution, do let me know. my email i.d. is babu_says@yahoo.com
|
|
|
|
|
Hi
I wonder if MS-SQL use some hashing table when i create
atable in which the key is a string(URL)
if no,do you think that by using hashing function on each string
and stroing the result(from the hashing function)
in the data base will increase searching performance...?
(the result is a numeric value)
thanks
tomer dror
tomerdr@hotmail.com
|
|
|
|
|
No I think it is a waste of clock pulses. Unless the information will not change once entered and only new unique rows are entered, otherwise I say why add clock pulses to the parsing of the string. Speed is the goal so KISS is the answer.
Best Regards,
Bob Zagars
|
|
|
|
|
Hi there all,
Well i'm trying to figure out a way to lock a record while working with an .mdb file (Access 2000).
When i try to set CRecordset::SetLockingMode(CRecordset::pessimistic) the system will throw an error saying "not supported locking mode" - IS THIS AN ODBC DRIVER PROBLEM OR ACCESS DB ?
So ... I tried to find a way to know if there is a way to find when is the record editted (from outside the program since 2 processes are running at the same time) and couldn't - Does somone have an idea of how to FIND OUT IF A RECORD IS EDITTED BY ANOTHE APP. ?
Thanks alot for the help i would apritiate it alot,
Ariel.
|
|
|
|
|
I get an IDispatch error #3092 when I execute a stored proc that does a rather basic insert into a Sybase SQL Anywhere database. I have reviewed the stored proc more than a dozen times, but cannot find anything wrong with it.
Where can I find the real meaning of such errors. Does anyone have an idea of what could be happening. I have posted the stored proc below. Error lookup does not give the correct result.
Create Procedure PersonAdd
(
@EntCode varchar(3),
@Accd varchar(3),
@FirstName varchar(40),
@MiddleName varchar(40),
@LastName varchar(40),
@Suffix varchar(15),
@Title varchar(25),
@PrevName varchar(35),
@Alias varchar(35),
@SSN varchar(11),
@BirthDate datetime,
@Sex varchar(6),
@IDTypeCode varchar(10),
@IDNo varchar(15),
@IDState varchar(15),
@TaxID varchar(11),
@EthnicCode varchar(10),
@RaceCode varchar(10)
)
AS
INSERT INTO Person
(EntCode,
Accd,
FirstName,
MiddleName,
LastName,
Suffix,
Title,
PrevName,
Alias,
SSN,
BirthDate,
Sex,
IDTypeCode,
IDNo,
IDState,
TaxID,
EthnicCode,
RaceCode,
DateCreated,
UserCreated)
VALUES
(@EntCode,
@Accd,
@FirstName,
@MiddleName,
@LastName,
@Suffix,
@Title,
@PrevName,
@Alias,
@SSN,
@BirthDate,
@Sex,
@IDTypeCode,
@IDNo,
@IDState,
@TaxID,
@EthnicCode,
@RaceCode,
GetDate(),
user_name())
DECLARE @PersonID INT
SELECT @PersonID = @@IDENTITY
RETURN (@PersonID)
GO
|
|
|
|
|
Try executing this from SqlAdvantage to see what it returns. What is @@IDENTITY ? Is it an int or some other data type?
|
|
|
|
|
Does anyone have an idea of how you can retrieve/return the value of a primary key (IDENTITY/Autoincrement COL) value after an INSERT statement using ODBC or ADO (without a stored proc). I am not using a stored proc, and so cannot use the @@IDENTITY function. I am using Sybase SQL Anywhere and MS SQL Server 7 as my databases.
Any suggestions or code samples would be appreciated.
|
|
|
|
|