|
Dear codeproject users,
I need to build a system for put in communication information providers and users.
I mean that I should have a database with some columns like, Name, address, phone#, email, stocklist.
Every provider of informations will have it's account, and will be able to update his information, like when they have a change in stock list, when they change the phone number (frequently since they move a lot), etc.
The users need to search in the database for the people that match their criteria, like, they live in the same address, the have stock list of "Java programming books". etc.
I hope you got the idea.
Now I tought I need 1 database, and 2 applications.
The provider application will let every provider log in it's account with a USERID and a PASSWORD, and afther that modify trough the APP his row in the database, update columns etc.
The user application will let every user search in the database with some criteria.
Ok.
Now I want to know.
How I make a database of this kind, where a provider can logon and modify ONLY one row in the database.
How I build the application, I am supposed to use Visual C++ (with .NET if necessary).
I think you understand that I ask this because I'm a beginner!
Thank you.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
please refer to CodeProject -> database -> Ado.
you may find articles for beginners .
you also need to know some transact sql programming.
don't giveup.
It's will take a while.
Aizik Yair
Software Engineer
|
|
|
|
|
I have a situation which I am trying to solve just by creating SQL's without programming because of some installation requirements. I did not have any luck with it. Was wondering whether anyone knows of a solution :
Here is the situation-
DB2 Table 1:
------------
FirstName LastName DateOfBirth History Date
--------- -------- ----------- ------- ----
Joe Smith 01/01/95 05/25/1997
Joe Smith 01/01/95 11/01/1997
Bob Smith 05/07/55 10/01/1998
Sherri Gaston 11/11/73 11/15/1999
Sherri Gaston 11/11/73 12/20/1999
Sherri Gaston 11/11/73 05/05/2000
Primary Key in the above table is FirstName, LastName, DateOfBirth.
From the above table I am trying to create a "daily" level table which will have a record for every primary key starting from the history record date to the next history record date.
So for example the result for "Joe Smith" will be
Joe Smith 01/01/95 05/25/1997
Joe Smith 05/26/1997
Joe Smith 05/26/1997
Joe Smith 05/26/1997
Joe Smith 05/26/1997
.........until 11/01/1997 (his last record's history begin date).
I don't mind building intermediate temporary tables. Can anyone help or thing of something?
Thank you
M
|
|
|
|
|
I am working with C++ and MSAccess trough ODBC and I have a ligistics nightmare when it comes to releasing new versions of my databases. Right now, If I make a change to my database structure I have to write a little patch program that will add, remove, or edit columns or tables in the database and these things are hardcoded and can only work for specific versions.
I was wondering if anyone knows of any utility programs that will let me make the changes over multiple versions. Basically, if the user has version 1.0 and wants to upgrade to 3.0 the utility will then change the existing database appropriatly. Or a user wants to go from 2.0 to 3.0 and so forth.
So a utility that will let me store what needs to changed in the database from version to version, and make these changes on upgrade. That way, the users don't lose any data and the program won't crash from trying to access a column that was not in the older versions.
Thanks in advance,
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
Don't know if this helps but thier is a undocumented access command switch /decomplie.
It will upgrade or change the database to your version of visual basic. Needless to say use with extreme caution.
MSACCESS.EXE /decompile c:\somename.mdb
For a utily to handle different versions You might want to try MS Project.
|
|
|
|
|
I don't know of any utility that does this, but the problem is the same with any database tool you happen to be using.
What I have done in the past is to write a conversion utility to convert from V1 to V1.5, V1.5 to V2, etc. Instead of updating the database they are using you might consider moving their data into a new database instead. What I do is if they are installing Version 3.0 over version 1.0, I do 2 conversions. First I move their data from 1.0 to 2.0. And then I move the converted 2.0 database to 3.0.
Pain in the but, but I only have to deal with the 2 most current versions at any given time.
|
|
|
|
|
Is it possible, within a stored procedure, to get server IP?
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
|
|
|
|
|
Its ugly (I'd go so far as to say "pug fugly"), and you'd have to parse the results...
<br />
use master<br />
go<br />
<br />
exec xp_cmdshell 'ipconfig'<br />
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
.. or you could write an extended stored procedure ??
|
|
|
|
|
Hi, I'm having big trouble accessing recorset elements. I'm using ODBC(MSSQL) with CDatabase and CRecordset objects, I can perform SQL executes, and even seem to open recordsets without bother but come into trouble when I try to access a recordset field.
I have CDatabase* called pDB. I have used recordsets previously but only used to check the number of rows returned (and thus not attempted to read any fields).
As far as I can tell there shouldn't be a problem here (I've copied most of this section straight from MSDN). The SQL statement returns a 1 row of 1 field recordset and the datatype of that element is varchar.
Hi, I've written the following code
char strSQL[2048];
try {
sprintf(strSQL,"SELECT DataValue FROM dbo.SSEData WHERE (DataName = N'LOGON')");
printf("%s\n\n\n", strSQL);
CRecordset rs(pDB);
printf("Just setup Filter\n");
if ( rs.Open( CRecordset::snapshot, strSQL) )
printf("Just opened recordset\n");
else
printf("Failed to open recordset\n");
if (rs.GetRecordCount() == (long)0){
printf("No records found");
} else {
if ( rs.IsEOF() )
printf("The recordset was EOF");
if ( rs.IsBOF() )
printf("The recordset was BOF");
printf("Field Count : %d \n", rs.GetODBCFieldCount() );
rs.AssertValid();
printf("Recordset was greater than nothing\n");
CString CStartupMessage;
CDBVariant CVariantField;
printf("In between the first and last string\n");
// rs.GetFieldValue( (short)0, CVariantField );
rs.GetFieldValue( short(0), CStartupMessage);
printf("Got the field value\n");
}
rs.Close();
} catch(CDBException *e){
printf("Caught a DB exception\n");
e->Delete();
} catch(CMemoryException *m){
printf("Caught a memory error\n");
TCHAR ErrorMessage[256];
m->GetErrorMessage( ErrorMessage, 255);
printf("Finished capturing error %s\n", ErrorMessage);
}
The Output from this code is:
<database opened="" successfully="" +="" few="" operations="">
....
Just setup Filter
Just opened recordset
Field Count : 1
Recordset was greater than nothing
In between the first and last string
Caught a memory error
<end>
Can anybody help me ????
Thanks, Damian Del Campo (damian_jose@yahoo.com)
|
|
|
|
|
|
Can SQL Server 2000 and Oracle 9i live on the same machine?
|
|
|
|
|
Yes...;)
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Yes, can do...;)
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
|
If I have a database on one hosting companies servers and it's huge like 300mb and I was interested in switching providers how would I transfer my database from one to the other...?
is there a command to convert binary database data into a text file dump of SQL INSERTS...?
If so...would I then just ask the new hosting company to convert the text file into binary again...?
Thanx again!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
is there a command to convert binary database data into a text file dump of SQL INSERTS...?
Yes, the mysqldump command does exactly that (most other database severs have a similar dumping utility). You need command-line access to the database server to use that command.
|
|
|
|
|
If they're both using SQL Server search for "Detach" & "Attach"
on SQL Server 2000 right click the database tree node.
with SQL Server 7 I believe you'll have to use a couple of system stored procedures.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
I imagine SQLServer has similar priv tables...so i'll ask away.
Does the mySQL Hosts table allow you to specify which host people can open your database from...?
Like could this be used to prevent people from using my database on there own site...?
Is that the purpose behind the Hosts table...or does it limit users from accessing the database...
That doesn't seem to make sense, because I use a dialup ISP and my IP changes periodically (i think) so if I returned later the database might now recognize me...
Am I correct in thinking the host table serves the above mentioned purpose...?
Only scripts run on www.mydomain.com would have access to my database stored on mydomain.com...?
Please tell me I am correct...?
thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi
How do you protect sensitive data (like CC numbers)? Also, when an application needs a DSN (C++ app), is there a way to hide this DSN and the application can still have it, without being hardcoded, or without human intervention.
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
|
|
|
|
|
Over the last few days I have read many tuts and a few books on database...alot of what I read wasn't what I wanted to know...database security for instance...anyways...after much reading I have come to conclusion that the general census for CC security is "Don't have CC #'s in your database PERIOD".
Although I figure public/private key encryption would do the trick considering thats what SSL uses. The books and tut's really stressed your clients lack of interest in having you store their password on a server...
Prolly a bad idea.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
In most situations it is not recommended to store CCs in a database. The reason for this is security and privacy. Unless you inform your users you are storing their CCs in a database you should probably avoid this. If all you need is transmission security, SSL is the only real option. Note: there are a few JavaScript/client-site encryption mechanisms out there too, but they would not be considered the norm by users.
If you do need to store this type of sensetive data I recommend using STRONG encryption on it when you store it in the database. The windows Crypto API can do this for you as well as numerous other libraries available from various vendors. Also many of the web-site certification comapnies require that if you do store CCs you must have a policy in place for purging the data within a specified amount of time (90 days seems like what I remember.)
If you really want to hide your DSN, put it in the registry and encrypt it also.
|
|
|
|
|
Yes you need to use a connection without a DSN for example:
strConnection = _T("Driver={SQL Server};Server=MyServerName;Trusted_Connection=no;Database=MyDatabaseName;Uid=MyUserName;Pwd=MyPassword;");
Best Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Tx a lot for the answers
If I shouldn't keep CC # in the database, where do you suggest I put them. Remember that the application needs them for later use (when settling the transaction for instance).
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
|
|
|
|
|
If you must keep the CC's for an extended period of time (longer that the user stays on your site), then a database is probably the only good way to do this. The key (IMHO) is to secure the database and the numbers to the maximum level possible AND to have a good procedure in place for removing those numbers from the database in a timely manner. You must also keep all the other identifying information as well (name, address, etc.)
Basically, like I said before the key thing is encryption. The other thing you can do in addition to encryption is to further scamble the numbers by keeping various parts of the #'s encrypted in different ways and stored in different columns in a table. If you are using Oracle or SQL Server you can further increase security by using column level security and setting it up so that only a call to a stored procedure with a good (highly random) keycode can retrieve the CC values.
Before I would recommend to a customer to store CCs in a database accessed via web-based systems, I would want to insure that the database itself was properly secured and that the web sites exposing the database were properly secured.
|
|
|
|