|
Try replacing all of the single-quote characters in searchValue are replaced by two single-quotes. So your final select expression for "O'Leary" becomes:
myFieldName = 'O''Leary'
Hope this works for you.
Andy
|
|
|
|
|
Thanks for the quick and accurate suggestion. That did the trick.
|
|
|
|
|
Hi,
I am creating a table using ADOX, in VC++ dynamically. And creating fileds in the table, but i am not able to create MEMO fields with zero length and not required attributes.
Can someone help me out on this one.
Mayank Goyal
|
|
|
|
|
Hi..
I have a table that i want to make some updates , inserts to it..
the new values are read form an XML file (which contains the new valuse)..like this:
rs.Open "Update.xml", , adOpenStatic, adLockReadOnly, adCmdFile
now I want a direct way to update existing fields and insert the new ones..
I can make a loop .. search for each existing record by ID , update it.. And if not found
I insert it ,, but this is not fast, smart enough, any suggestions ?
|
|
|
|
|
hspc wrote:
now I want a direct way to update existing fields and insert the new ones..
I can make a loop
Whatever the solution is, it is going to involve a loop of some sort and multiple UPDATE statements. It simply has to. (Though technically you could create a DTS package which opens the XML file at location and then runs. But DTS can be a PITA IMO.)
The main thing though is to get this loop out of your ASP file.
The easiest way I can think of is to open the XML file, pull out the values you need into a string which is comma delimited (how big is this XML file?) You then pass that string to a stored procedure and let the SP do the looping (far faster as it is "inside" the database.)
DTS might be the best way though actually as it will be more flexible if source fields need to change.
You could also write your own windows service/app and let it regularly check the XML file.
Main thing; Get the loop out of the ASP page.
Paul Watson Bluegrass Cape Town, South Africa
Chris Losinger wrote:
i hate needles so much i can't even imagine allowing one near The Little Programmer
|
|
|
|
|
thank you Paul for your suggestions
the XML file can be more than 50KB.. I can read it effeciently using RecordSet.Open mehod..
the insert and update is the problem..
|
|
|
|
|
Hello,
I develop a desktop application with MS VC++ 6/MFC/ADO that uses a MS Access DB to store my application data (in a .mdb - local database - file).
I would like to :
- protect the DB integrity by encrypting it or at least hiding that it's a MS Access DB to the user (renaming the .mdb to .dat is not enough)
- try different DB engine to handle the file, even if it's not a MS Access one anymore
- handle the local DB with NO server running (can't do it with MySQL++ for example, see below)
I'm not a DB expert so I don't know much about DB engines and Visual DB managers.
What do you guys use as a DB engine ?
Actually here's a list of the following DB engines or systems I want to try or already know :
- MS Access : can't design my DB and handle it from my app, everything is "perfect" but I want to try new things... And I don't know how to encrypt its data or protect it from the users
- Visual FoxPro : It's part of my MSDev 6 Pro package but never really gave it a try. It sounds like an other MS Access to me... What are the main differences ? Maybe I can easily protect my DB integrity with it... Does anyone know or use Visual FoxPro ?
- CodeBase : DB engine that supports tons of IDEs and languages ! If you know it or use it, what do you think of CodeBase ?
- MSDE : someone adviced me to use MSDE but It's part of MS SQL Server 2000, It seems that I can't download it from the MSDN website, it's not MSDev 6 compliant (only supported by .NET). Note that I can't affort MS SQL Server 2000, far far too expensive and I don't need such a DBMS for my the softwares I develop
- MySQL : I really like MySQL because I also develop web based applications, however I have to connect to a "host" in order to access the DB, I can't connect to a file with ADO or MySQL++ (MySQL C/C++ API)...
- XML Database : for small DB I thought It could be nice to use a DB engine that uses XML files (manage a configuration file, address book...), what do you think ? Do you know of any good API ?
Kind regards,
JM. Molina
Europe > France > Lyon
|
|
|
|
|
MS-Access does provide encryption. Choose "Tools->Security->Encrypt/Decrypt Database" from the main menu. I know at least one major bank that uses Access in this way.
You should be able to find a copy of MSDE on the Microsoft Office-2000 installation CDs (its not installed by default). MSDE is basically a stripped-down version of SQL-Server. I have a copy installed on my kids' Windows 98 box. The main problem is that no administration program is provided (like SQL-Server's Enterprise Manager). However, there are freeware program available that replicate much of this functionality for you. Note that MSDE is implemented as a server process (just like SQL-Server) - so this may rule it out as an option for you.
If you are not storing much data then you might take a look at ADO presisted-recordsets. These are written to you PC's disk as an XML file. The main problem with this (and XML in general) is that the files are not encrypted. For more complicated XML, you would probably use Microsoft's MSXML component.
Hope this helps.
Andy
|
|
|
|
|
Hi Andy,
MS-Access does provide encryption. Choose "Tools->Security->Encrypt/Decrypt Database" from the main menu. I know at least one major bank that uses Access in this way.
I know I can encrypt my DB. I also protect it with a password. I can't believe the passwords are not even encrypted if the DB is not encrypted too... If the DB is only encrypted, users can read it with MS Access and I don't want them to. If the DB is encrypted and password protected, they can't read it anymore... Unless they use one of the dozen of "password recovery tools" you can get everywhere on the web. Which means my DB is not protected at all. What really worries me, it's that they can retrieve my DB password. It's unreadable... first... my application connects to it using a password... But when the user uses a password recovery tool on it, they get the DB password AND users passwords. Passwords I would use for all my DBs, accounts... My solution would be to release a special DB, protected by a "dummy" password (only known by the application), with a special user account that has read and write access to the DB, tables... But It requires a lot of modifications and messes up my all release process.
You should be able to find a copy of MSDE on the Microsoft Office-2000 installation CDs (its not installed by default). MSDE is basically a stripped-down version of SQL-Server. I have a copy installed on my kids' Windows 98 box. The main problem is that no administration program is provided (like SQL-Server's Enterprise Manager). However, there are freeware program available that replicate much of this functionality for you. Note that MSDE is implemented as a server process (just like SQL-Server) - so this may rule it out as an option for you.
Alas! I can't use MSDE. Moreover I am sure there's somekind of perfect security system for MSSQL DB.
If you are not storing much data then you might take a look at ADO presisted-recordsets. These are written to you PC's disk as an XML file. The main problem with this (and XML in general) is that the files are not encrypted. For more complicated XML, you would probably use Microsoft's MSXML component.
There are hundreds of APIs and XML-DBMS and I don't really know which one to pick... The Apache one sounds like a good choice to me. About security, I am sure that some of the XML DBs have a security layer.
Decrypt Database
Did you ever tried to Decrypt a MS Access DB ? If I exclusively open an encrypted MS Access DB, when I select Encrypt/Decrypt, it doesn't ask me to decrypt it, it askes me to encrypt it... again.
Summary
What do you think of my "dummy password" hybrid solution and the password recovery tools issue ? If any, what DB engine do you use for your own softwares ?
JM. Molina
Europe > France > Lyon
|
|
|
|
|
The "dummy" password solution seems to work just fine. However, I am a contract programmer, so I've only have to show that I have taken sufficient steps to put security in place. As far as password recovery tools go, I would advise that you use a strong password that doesn't appear in the dictionary.
I never had to decrypt the MS-Access database. However, Microsoft provides a program named "JetComp.exe" on their support web-site. Normally I use it to fix MS-Access databases that have got seriously corrupted. If anything could decrypt your database it would be that program.
I don't have any real preferences for databases. I've used quite a few different ones (I tend to use what my clients ask for). My personal preference is not to use MS-Access (network performance sucks and it is fairly easy to corrupt the database files). You might want to consider Sybase's ASA database (used to be called SQL-Anywhere).
Hope this helps.
Andy
|
|
|
|
|
HI ALL
I am having problem with the custome error message display. As in Visual Basic 6.0 days we could give our custom error messages by getting the error code how we can achieve the same in C#. where can i get the mappings of errorcode returned by the exception so that instead of displaying the default error message i should be able to display my own custom error message on the same exception
THNX IN ADVANCE
Love U ALL
|
|
|
|
|
I would like to run a query on the results of a previous query.
I know I can use SELECT in a SELECT, but the query I'm doing is not allowed to be a subquery (it's a TRANSFORM).
I can run a query on a query from Access, I just want to do the same thing in MFC.
Any ideas?
Cheers
Neil
|
|
|
|
|
A query on a query in SQL Server can be implemented in several ways:
1) create the initial query as a view and then query the view
2) insert the initial query results into a temp table and then query the temp table
3) create a table variable and insert the results of the initial query into the table variable. Then, run the second query using the table variable.
4).... and on and on limited only by your imagination and the specifics of your query(s).
|
|
|
|
|
Can you tell me how to do this on a TRANSFORM statement. As far as I can see, you can't TRANSFORM INTO a temp table.
Maybe I'm wrong?
Cheers
Neil
|
|
|
|
|
basementman wrote:
A query on a query in SQL Server can be implemented in several ways:
1) create the initial query as a view and then query the view
2) insert the initial query results into a temp table and then query the temp table
...
In .NET I've attempted to use method 2 and then define a data adapter to the stored procedure. The data adapter wizard gives me an error stating
that the temporary table is not valid. Any idea how to make this work correctly?
>>>-----> MikeO
|
|
|
|
|
Hi!
I have to tables (master-detail) within DataSet. How can I display in DataGrid result of INNER JOIN operation of these tables?
P.S. Decision based upon adding into the dateset's child table extra columns that refer to the parent column (using column expression 'Parent.') is unacceptable.
|
|
|
|
|
Question: Why do you consider the parent column expressions to be unacceptable? Can you tell us more about the problem that you are trying to solve (i.e. do you want to allow the user to edit the contents of these parent columns?).
|
|
|
|
|
Yes, I want to allow edit the contents of parent columns. Will contents of such column (that refers to the parent column through use of column expresion) be copied into the parent table (if I alter some cells)?
|
|
|
|
|
Dr_Sh0ck wrote:
Will contents of such column (that refers to the parent column through use of column expresion) be copied into the parent table (if I alter some cells)?
Yes. Actually, what's created is just a pointer.
And a pointer can be, in the RAM world, the equivalent of a foreign key in the RDBMS world.
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
I couldn't add a time part of a DateTime in an Access table, using VB.Net
It always adds only the date part.
What is the problem?
Here is the scenario:
My table contains 2 fields - one DateTime field and one TEXT field.
I have a DataAdapter and a Dataset, an I am using the following code:
DsLog1.Tables("Log").Rows.Add(New Object() {"#01/02/03 04:05:06#","SomeText"})
OleDbDataAdapter1.Update(DsLog1)
As a result I got only the date part 01/02/03 into Access table
I know, that that is not due to a field format in the table, because if I add the same value directly in Access table (using access), I can see the new added time value, but not the one, added by the code above.
Any suggestions are welcome.;)
Thanks in advance
Yakimo(to)
|
|
|
|
|
make sure of the table design
the field must be General Date not short date
|
|
|
|
|
It is General Date, because if I add DateTime from the Access itself, I can see the time.
But not the time, added by the VB.NET code.
Maybe I am doing something wrong?
|
|
|
|
|
I have a simple update statement on a table on MSSQL7:
UPDATE MERENI SET MERENI.Hod=-0.5, Kval=' ', Zmena=1 WHERE Ident = 'SLV4485_MI__'
This runs O.K.
When I change it to modify other record:
UPDATE MERENI SET MERENI.Hod=-0.5, Kval=' ', Zmena=1 WHERE Ident = 'SLV4485_MQ__'
It ends with:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '/'.
Pavel
Sonork 100.15206
|
|
|
|
|
Solved. I forgot about a trigger.
Pavel
Sonork 100.15206
|
|
|
|
|
Can anyone please tell me what method I need to use to connect and talk to a MYSQL database through ADO.NET. Not one that has been read about, one that has been tested and used. Please, I need help????????????
Thank,
Kendal
|
|
|
|