|
Misleading title - it isn't that password validation doesn't work, it's just that the SQL query is not case sensitive. You'd have to retrieve the password for a given username and compare it in code. I'm not aware of a way to make Access case sensitive, although you can do it for SQL Server (and hence MSDE).
Steve S
|
|
|
|
|
It is refer to your database(or table or column) COLLATION . You have to set it to a case sensitive value. You can change collation with ALTER TABLE or in Enterprise Manager in the Design View of table for each column at the bottom of page you can change it. You have to select one of values which contain CS , means Case Sensetive.
Mazy
No sig. available now.
|
|
|
|
|
You should never store passwords in clear text. If anyone manages to obtain the database (downloading the file, executing a SELECT via a SQL injection attack, etc), your entire authentication mechanism is compromised. Users will not be happy if they've used the same password for multiple systems/websites/whatever, and you've disclosed it.
You should calculate a secure hash (using a cryptographic hashing/message digest scheme, not one you invent yourself) and store that in the database (you'll probably need to convert the bytes to hexadecimal). When authenticating a user, you again hash the provided password and compare with the stored one.
To calculate a cryptographic hash, you can use the CryptHashData function in the Windows API, the CAPICOM object library (if using VB 6 or a scripting language), or the System.Security.Cryptography.HashAlgorithm .NET Framework class.
There are various other techniques that are an extension of this which can provide more security, such as encrypting the hash, and/or adding a random 'salt' to the password before hashing.
|
|
|
|
|
Hi everyone,
Really new to using SQL Server. I've installed MSDE and I'm using the osql utility to access the db and I had a question about formatting output. I know in Oracle I could do something like
column Item format a18 and that would format the column so that it was only 18 character wide. Does anyone know how I would accomplish this same thing with MSDE using the osql utility?
Thanks.
- monrobot13
|
|
|
|
|
LEFT(<field_name>, 18) or SUBSTRING(<field_name>, 0, 18)
|
|
|
|
|
Exactly what I was looking for. Thanks!
- monrobot13
|
|
|
|
|
Hi,
I'm trying to use the SqlDataAdapter, but I need to know how many rows the SqlDataAdapter had. There is some way to know more easy that:
<br />
SqlDataAdapter datareader;<br />
int i = 0;<br />
while(dataReader.Read()){<br />
i++;<br />
}<br />
Thanks
----
hxxbin
|
|
|
|
|
I'm not sure there is way to get the count of rows on a sqlDataAdapter.
The sqlDataAdapter.Fill method fills a Dataset or a DataTable. Once the dataset or table is populated you can get the row count from the
Dataset.Tables(0).Rows.Count or DataTable.Rows.Count method.
Dim ds As Dataset
sqlDA.SelectCommand.Connection = cn
sqlDA.Fill(ds)
sqlDA.SelectCommand.Connection = Nothing
Return dataset
With the dataset or DataTable populated you can obtain the rowcount by doing the following:
ds.Tables(0).Rows.Count
dt.Rows.Count
Michael
|
|
|
|
|
I think you meant SqlDataReader (the rest of the code looks like that).
There's no way to find out in advance how many rows are going to be retrieved. The SqlDataReader won't allow you to rewind anyway.
If you need to store the data temporarily (maybe you need to do multiple passes over it?), consider a DataTable. If that has too much overhead for you, use some automatically-growing data structure such as an ArrayList - you can always use the ArrayList's CopyTo method to copy it to an array once you've retrieved all the data.
|
|
|
|
|
Yeah, I meant SqlDataReader, sorry. And I going change my code to SqlDataAdapter.
Thanks.
----
hxxbin
|
|
|
|
|
Hello!
I'm in the process of porting a DAO application to ADO and I'm a bit stuck.
In DAO I can get the name of the database using CDaoDatabase::GetName().
How do I do this in ADO?
Anders Eriksson
Sonork 100.21825
|
|
|
|
|
Hi, I know this is mainly for SQL, but I am hoping someone can help. I have the following problem, which I need to find a solution for. I have a table with unique transaction ids, customer ids, payment dates and payment amounts. I need to find out what someones last pay date was. I cant seem to find out how to group by the customer ID, showing only their most recent pay date. That would get me to solve the problem. Just remember that each customer can have multiple transactions.
If you can help me, please do. I have no idea how to do this query. I have been trying, but have not been succesful.
|
|
|
|
|
Without knowing your tables fields etc:
Select * from table a
where a.date = (select max(b.date) from table b where a.cust_id = b.cust_id)
Hope this helps.
Grtz, Guus
|
|
|
|
|
Hi, just to clarify all the data is in one table. Would this still work?
|
|
|
|
|
Just a swag:
Fetch the recordset with:
SELECT * FROM tablename WHERE custID = customernumber ORDER BY transdate
then use MoveLast to find the last payment by the selected customer.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
What's wrong with this?
SELECT MAX(PayDate)
FROM Table1
GROUP BY CustomerID Untested, but my reading of the Access (2003) help file indicates it should be supported. Access 2003 uses the same Jet 4.0 engine and query processor as Access 2000 and XP.
|
|
|
|
|
How do I view the contents of a .mdb file? I've searched all over, and the only program I found was shareware and just listed the field names, not their values. I'm brand-new to database programming, so please share even the most basic advice. If it helps, I'm trying to access Adobe Album 2's database file that stores the locations and tags of photos; the file ends in .psa, but I was told by a developer at Adobe that it's just a simple Access database (which it appears to be).
|
|
|
|
|
Can't you open it with Access?
You can view the Bitmap fields by Paint from Access, otherwise simply write an application that read image fields and show each picture there. (You said you know the name of fileds)
Mazy
No sig. available now.
|
|
|
|
|
The problem is, I don't have Access (the Academic version of Office 2003 doesn't include Access), and I don't think the shareware app listed all the fields. The database file is only ~300kb for ~50 photos, so I think it just has filenames and metadata.
|
|
|
|
|
Use VS.NET. Server Explorer.
Free your mind...
|
|
|
|
|
Thanks, that works great
|
|
|
|
|
Have you tried Microsofts free Access viewer?
|
|
|
|
|
That was the first thing I looked for, but I couldn't find one - I only found an Access snapshot viewer, which only opened *.snp files.
|
|
|
|
|
Well just try this one: I open my .mdb file with Excel and it works,at least you can see name of fields and table and value of non-image fields.Then with the name of them you can write your own application.
Mazy
No sig. available now.
|
|
|
|
|
I've suddenly started getting this error in an application -
ConnectionTransact (TransactNamedPipe()).
Connection broken.
State:01000,Native:6,Origin:[Microsoft][ODBC SQL Server Driver][Named Pipes]
State:08S01,Native:4,Origin:[Microsoft][ODBC SQL Server Driver][Named Pipes]
The odd thing is that it's not a named pipes connection - it's using tcp/ip. I'm using SQL Server 2000 with a 1-processor licence; the only references I can find to this error suggest the number of licences may be too small, but this shouldn't be the problem here. Anyone any ideas?
Keith Worden
|
|
|
|