|
I created an address book with a login dialog box. It works fine. Now I would like to change the password and or user id. How can I do that?
bravo659
|
|
|
|
|
Magic.
For a better answer, you'll need to tell us how you created your login box in the first place. Given that you're in the SQL forum, I'm hoping you have a database with a table of usernames and passwords. If that is so, I'd have thought all you need to do is add to this table.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
you need to do is add edit to this table.
<italic>Work hard, Work effectively.
|
|
|
|
|
Depends on what you mean by edit. He needs to add a row if he wants to add a new user, assuming everything is set up decently.
However, if you regard adding a row as editing, and adding a column as adding, then you'd be right.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Now I would like to change the password and or user id. How can I do that?
By editing/ updating the record/row.
<italic>Work hard, Work effectively.
|
|
|
|
|
OK - you've got me. He needs to change a row, and I'm an idiot.
I missed the 'or'. One has to hope he doesn't intend on only having one user, but changing the details from time to time.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I'm an idiot
Nah, you're just didn't read it carefully.
<italic>Work hard, Work effectively.
|
|
|
|
|
What i like to do since i already have the login box that i need to enter a user id and a password, I would need to change the password time to time.
How about adding more users with passwords?
I am fairly new to this sql server programming, but I am also using the MS Access to make it easier to understand what I am doing. Even though, all I have to do is change the Access to sql, and vice and versa. How can I do that?
bravo659
|
|
|
|
|
I reiterate - I need to know where your username and password are coming from, and how you use them, to answer more fully. However, if they are in a tabe of usernames and passwords, then you should be checking log in by looking for a username/password pair in the DB that's the same as what was entered. So you just need to edit a row to change the password, or add a row to add a user.
If the user is used for any authentication, etc, it should also have an ID, and any reference to the user done via ID. Then you can change the name, too.
If you have an Access DB and a SQL server one, and you don't use stored procedures, I'd imagine you could just connect to either from your code with no trouble.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What I am using is a userID and password in the Access DB tables.
What I would need to know is when I add a new child form, what would be the code to add and change a password.
In the first form for userid and password it has two textoxes, two buttons
for login and exit. Now, the child form would be with a three textbox, one for old password, change to new password, and authenticate new password.
If i want to change the username then I would create change username button which another form would appear to change the username. I really dont know how to code these changes. Could you help me in this instance.
bravo659
|
|
|
|
|
UPDATE tblLogin SET password = 'newpassword' where username = 'DessiBravo'
INSERT INTO tblLogin (username, password) VALUES ('christianGraus', 'hisPassword')
This is, of course, pseudo code in that I have no idea about your database schema.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I greatly appreciate for your assistance. I got the gist of it.
Another thing, how is C++. I am planning to go back to college to take up computer programming, and the school offers C++. I am currently using VB.Net. How is the comparison between the two.
|
|
|
|
|
VB.Net is a good language for knocking together basic applications without too much effort. C++ is harder to learn, because it's more powerful and more flexible. I'd recommend buying a book like 'Teach yourself C++ in 24 hours' in order to get a feel for it before signing on for a course. It's very different to VB.NET. However, whatever languages you learn, I think you're always better off for knowing at least 2 well, it makes you more of a programmer and less of a slave to one language.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys,
I want to replace two values in a column and I don't know how to do it with the replace function. I only know how to replace one.
select replace(col0, '100', 'add') as transaction_type
from sometable
Thanks in advance!
|
|
|
|
|
try nesting the replaces:
select replace(replace(col0, '100', 'add'), '200', 'del') as transaction_type
from sometable
|
|
|
|
|
Hello,
I need to add a new record in an Access database. The database has 4 fields:
[id] (autonumber)
[title] (string)
[text] (memo)
[publication_date] (DateTime)
I created my code but it's not working. I can't find the problem.
Can someone help me?
My code is as follows:
Dim connectionString As String =
System.Configuration.ConfigurationSettings.AppSettings("connectionString")
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "INSERT INTO [t_news] ([title], [text], [publication_date]) VALUES (@title, @text, @publication_date)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection
Dim dbParam_title As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter dbParam_title.ParameterName = "@title"
dbParam_title.Value = "title example"
dbParam_title.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_title)
Dim dbParam_text As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter dbParam_text.ParameterName = "@text"
dbParam_text.Value = "text example"
dbParam_text.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_text)
Dim dbParam_publication_date As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter dbParam_publication_date.ParameterName = "@publication_date"
dbParam_publication_date.Value = DateTime.Now
dbParam_publication_date.DbType = System.Data.DbType.DateTime
dbCommand.Parameters.Add(dbParam_publication_date)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
Thanks,
Miguel
|
|
|
|
|
1. If you use SQL Query Analyer
Exec InsertTable2
Everything works fine.
2. If you use ADO to call stored procedure, as following code, the data will be inserted into the table; but you got empty recordsets returned.
3. If you comment out the Insert statement in the stored procedure, you will get all the recordsets returned. So the Select statement works.
4. This has nothing to do with the permission. Even with sa account, it behaves the same.
5. Does any one know why the Insert statement will block Select statement during ADO call?
----------------------------------------------------------
Create PROCEDURE [InsertTable2]
AS
INSERT INTO Table2 ( field1, field2) VALUES ('1', '2')
Select * From Table2
GO
The VB code to call this procedure
Private Sub cmdInsert2_Click()
Dim sSQL As String
Dim rs As ADODB.Recordset
Dim oCommand As ADODB.Command
Dim rStr As String
Dim index2 As Integer
Set oCommand = New ADODB.Command
sSQL = "InsertTable2"
With oCommand
.CommandType = adCmdStoredProc
.CommandText = sSQL
.ActiveConnection = cn
End With
Set rs = oCommand.Execute
Do While (Not rs Is Nothing)
If rs.State = adStateClosed Then
Debug.Print "Returned recordset is empty"
Exit Do
End If
Debug.Print "----------------------"
While Not rs.EOF
rStr = ""
For index2 = 0 To rs.Fields.Count - 1
If index2 = 0 Then
rStr = rs(index2)
Else
rStr = rStr & ", " & rs(index2)
End If
Next index2
Debug.Print rStr
rs.MoveNext
Wend
Set rs = rs.NextRecordset
Loop
Exit Sub
End Sub
|
|
|
|
|
The insert statement generates a result set consisting of the number of records affected. The select then generates another result set. When you get your recordset back, it is positioned on the first result set (the number of records inserted), so you have to move the recordset to the second result set before you can access it. Use the NextRecordset method of the recordset object to get to it.
If you are not interested in the number of records affected from the first statement, use 'SET NOCOUNT ON' at the beginning of your stored procedure, then the records affected will not be returned in the recordset, and you will have the values you expect returned in the recordset as normal.
Like this:
Create PROCEDURE [InsertTable2]
AS
SET NOCOUNT ON
INSERT INTO Table2 ( field1, field2) VALUES ('1', '2')
Select * From Table2
GO
|
|
|
|
|
Hi Scott:
It works.
Thank you very much
jchsiung2
|
|
|
|
|
Can anyone help me in suggesting a way to pull the number of active bugs for a particular databaase in the product studio using C#.NET
|
|
|
|
|
Hello,
I'm having problems with MSDE. Since approximately two days ago, it suddenly started slowing down randomly on the SqlConnection.Open() call. It just happens randomly, and most of the time it works fine, but it's common enough to be disturbing (maybe around every 5-10 minutes, and some calls can last up to a minute or more).
The network is made of only 3 clients plus one server, and the database is about 8 MBs. It's a LAN.
I checked http://www.petefreitag.com/item/194.cfm[^] and performed the concurrency check and there are none.
So, does anyone here have any ideas? any more details I could provide?
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I've not really used MSDE, so the solutions are a bit of guesswork. MSDE uses connection throttling after so many connections are made (This is to nudge the user to upgrade to a non-free version of SQL Server.)
Are you ensuring you are closing the connections properly? Are you opening connections from more than one process? (possibly even multiple connections within the same process?)
Like I said, these are just guesses as I've not really used MSDE, just SQL Server.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Colin Angus Mackay wrote:
Are you ensuring you are closing the connections properly?
Well, I suppose so.
Colin Angus Mackay wrote:
Are you opening connections from more than one process? (possibly even multiple connections within the same process?)
No, just one process per client machine is using the database, and nobody else. Actually I started the development with one global connection opened in Main at startup... and later changed it to using(SqlConnection conn = new SqlConnection(...)) for all new code. So, at most there should be two connections open by process, and most of the time only one. And for three clients, that's only 6 connections at the very most.
What puzzles me is that it started happening suddenly, and not progressively as one would expect with this kind of performance problems.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hi
I need to transfer the data from ms access to sql 2000 using Replication
I do not know how to do.
Could any one help in this regard?
|
|
|
|
|
You need to use DTS not Replication.
|
|
|
|