|
We have a client/server database app that uses ADO.Net and runs over a LAN.
One potential customer asks why we don't use a secure network connection (we deal in a lot of personal info) for our DB traffic, and I want to say that ADO.Net is 'secure enough', as we only operate over a company LAN. But I have to admit I'm not sure.
We do all the standard stuff (DB permissions, Windows authentication, encryption of connection strings and passwords, validate input values, role based controls etc) but I am wondering about the network transport aspect of ADO.Net. MSDN doesn't say much other than you can encrypt sensitive data (but all our data is sensitive!) or use a secure connection.
How easy is it to snoop ADO.Net traffic over a standard connection?
Does anyone here use ADO.Net with either encryption or a secure connection (IPSec/SSL)?
Ta, Adam
|
|
|
|
|
adambl wrote: How easy is it to snoop ADO.Net traffic over a standard connection?
Not sure. You could just send everything through an encrypted channel.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have Error Message #3251 that occurs when I try to update one of the fields from one table based upon the value stored in another table. I am trying to compare the values of several fields in each of two tables, and when there is a match, I would like to assign the value of the second table to the value of the first table. When all records have had assignments, then I would perform a link between the first table and another table in the database, and then export the results with a portion of the data from each of the two tables in a query. Seems easier than trying to match a composite key from one table against a composite key from the other table. Besides, I don't think it is possible to compare composite keys. It seems better to merely compare indexes.
Why doesn't it permit me to update the first table based upon results from the second table? I believe it has something to do with the Lock Type because the error message states: "Error and Error #3251: ADODB.Recordset: Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype." I need some assistance here.
Here is the code so far:
Private Sub ProcessHeadcountRecords()
Dim dbsHeadcount As Database
Dim Cnxn As ADODB.Connection
Dim strConn As String
Dim rstInputFile As ADODB.Recordset
Dim cmdSQLInputFile As ADODB.Command
Dim strSQLInputFile As String
Dim rstHyperionMany As ADODB.Recordset
Dim cmdSQLHyperionMany As ADODB.Command
Dim strSQLHyperionMany As String
Dim rstHyperionOne As ADODB.Recordset
Dim cmdSQLHyperionOne As ADODB.Command
Dim strSQLHyperionOne As String
Dim strDBPath As String
Dim strFileName As String
Dim strMessage As String
Set dbsHeadcount = CurrentDb
Set cmdSQLInputFile = New ADODB.Command
Set cmdSQLInputFile.ActiveConnection = Application.CurrentProject.Connection
strSQLInputFile = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
"[L/R/G], [REGION], [JOB FUNCTION], [09/12/2007 Reported], " & _
"[NUMINDEX] FROM [TBLINPUTFILE]"
cmdSQLInputFile.CommandType = adCmdText
cmdSQLInputFile.CommandText = strSQLInputFile
Set rstInputFile = cmdSQLInputFile.Execute()
rstInputFile.MoveFirst
Set cmdSQLHyperionMany = New ADODB.Command
Set cmdSQLHyperionMany.ActiveConnection = Application.CurrentProject.Connection
strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
"[L/R/G], [REGION], [JOB FUNCTION], [NUMFOREIGNKEY], [09/12/2007 Reported] " & _
"FROM [TBLHYPERIONMANY]"
cmdSQLHyperionMany.CommandType = adCmdText
cmdSQLHyperionMany.CommandText = strSQLHyperionMany
Set rstHyperionMany = cmdSQLHyperionMany.Execute()
Do Until rstInputFile.EOF
With dbsHeadcount
strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], " & _
"[BUSINESS UNIT], [L/R/G], [REGION], [JOB FUNCTION], " & _
"[NUMFOREIGNKEY], [09/12/2007 Reported] " & _
"FROM [TBLHYPERIONMANY] " & _
"WHERE [COUNTRY]='" & rstInputFile![COUNTRY] & "' " & _
"AND [TYPE]='" & rstInputFile![Type] & "' " & _
"AND [BUSINESS UNIT]='" & rstInputFile![BUSINESS UNIT] & "' " & _
"AND [L/R/G]='" & rstInputFile![L/R/G] & "' " & _
"AND [REGION]='" & rstInputFile![REGION] & "' " & _
"AND [JOB FUNCTION]='" & rstInputFile![JOB FUNCTION] & "'"
MsgBox (strSQLHyperionMany)
rstHyperionMany.Requery
'If rstInputFile![COUNTRY].RecordCount = 1 Then
rstInputFile![NUMINDEX] = rstHyperionMany![NUMFOREIGNKEY] /// HERE IS THE ERROR LINE WHERE I CANNOT ASSIGN VALUES
'Else
'MsgBox ("Record not found")
'End If
End With
rstInputFile.MoveNext
Loop
End Sub
|
|
|
|
|
new_phoenix wrote: Set rstHyperionMany = cmdSQLHyperionMany.Execute()
The Execute method returns a read-only recordset. You should use the Recordset.Open() method and specify an appropriate CursorType e.g. adOpenKeyset to make your recordset updateable.
Paul Marfleet
|
|
|
|
|
Hi,
I want to update the year in the datecolumn which has dd/mm/year format.
I just want to update the whole table and set the year to 2007 with out changing the month and date.
can u suggest me an answer
Thnks
Kittu.
|
|
|
|
|
Follow this link[^] to get the code for a useful UDF that will allow you to construct new datetime values.
Paul Marfleet
|
|
|
|
|
Does anyone know how to build an installer that will automatically install your database if it doesn't already exist? I am using Visual Studio 2005 Team, with SQL Sever 2005...I figured maybe using custom actions a script could be run to install the database before installing the application...any ideas?
Thanks for any help
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
I have an ID that increments automatically when I insert, but when I delete a record it never creates that ID again. I want my records to be numbered sequentially from zero up without skipping numbers. Thanks guys.
|
|
|
|
|
Dio22 wrote: I have an ID that increments automatically when I insert, but when I delete a record it never creates that ID again. I want my records to be numbered sequentially from zero up without skipping numbers. Thanks guys.
That is expensive to do because you have to renumber all items that come after the deleted item. Indexes will need to update themselves. Referential integrity has to be take into account (i.e. you will have to change the foreign keys on all tables that reference the one you are renumbering)
Unless you have an exceptionally compelling reason you should just leave the blanks where they are.
|
|
|
|
|
What is the value of re-numbering/re-using a previous key? If you are looking for a sequence of insert then add a DateTime column to your table and sort by that.
|
|
|
|
|
I suppose you're both right, I'm just obsessive about having things in order I suppose. I was going to access them in C# using a for loop that incremented by one. I can do something else though. Thanks for the input! Learn something new every day.
|
|
|
|
|
Hi.
How can I set Password for a DB (SQL Server), so that when opening a DB in Enterprise Manager, first ask Password?
Best wishes
|
|
|
|
|
Set your security correctly. It doesn't really make sense to put an additional password on the DB when the security system supports all necessary rights at the user (login) level.
|
|
|
|
|
Hi,
I'm working with SSRS. i need a report which will have an index page along with it. could any1 guide me through this??
Thanks,
|
|
|
|
|
I'm trying to send an INSERT and then have the server reply with the unique ID. Do these have to be seperate statements? can someone help me with the syntax?
here's what i'm trying, it doesnt return anything..
INSERT INTO QAHist
(Description, Handling, Cause, RecDate, Authors, ImageURL)
VALUES ('blah', 'moo', 'die', 'punk', 'arg', 'http://')
SELECT SCOPE_IDENTITY() AS [SCOPE_IDENTITY]
-- modified at 8:57 Wednesday 3rd October, 2007
|
|
|
|
|
Dio22 wrote: Do these have to be seperate statements?
Are you running this in stored procedure ? SCOPE_IDENTITY() returns the last value inserted into identity column in the same scope . Alternatively try IDENT_CURRENT() also. This returns last identity value for the table. It's not scope specific
|
|
|
|
|
It's not in a stored procedure, it's actually eventually going to be a call from a C# program. I'm just running it in a query analyzer right now.
|
|
|
|
|
Hi all,
Is there any way to retrieve the creation date of each row in a SQL table.
In my old table, I don't have [Creation Date] column. Table has already been created and data is also there. But i need to retrieve when each individual row of that table had been created. Do SQL maintain any log for each update of the table?
Please do suggest me what to do.
|
|
|
|
|
Anurag Gandhi wrote: Hi all,
Is there any way to retrieve the creation date of each row in a SQL table.
In my old table, I don't have [Creation Date] column. Table has already been created and data is also there. But i need to retrieve when each individual row of that table had been created. Do SQL maintain any log for each update of the table?
Please do suggest me what to do.
Without an explicit creation data, then no you can't. You can't rely on the rows timestamp because this isn't really a date/time - it just indicates when items were updated/inserted in the database.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Iam doing a project in ASp.net -Online exam
there are 25 questions and 4 options for each stored in SQL database .
I want one by one question to appear with 4 options.ie,
first page 1st question after NEXT Butoon clicked , 2nd , so on..
I also want each selected answer to check with actual correct answer stored in sql.
Please help.
thank u.
email to- e.suni@rediffmail.com
|
|
|
|
|
esuni wrote: Iam doing a project
Yes!! 'You have to do the project'
|
|
|
|
|
Your page will need to ask a question and display the possible answers, so you will need to display the question and put some radio buttons for the answers. When the user clicks Next, you will present the next question. What's your actual question? There's nothing in your post that indicates what you actually want. I sincerely hope that you aren't asking for somebody to actually write your code for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If you need and idea then i can give you.
first create a database which has a table with columns holding
QuestionNumber,QuestionText,Option1,Option2,Option2,Option2,CorrectAnswer.
Then display each question either randomly or one by one using the question number.
Now display even the options with a radio button besides each option. now when a person check a radio button and submits an answer then check whether the option is same as the correctanswer column value of the respective question. Then u can go on doin this for the whole test.
Thnks
Kittu.
|
|
|
|
|
I would like some opinions on my database design. I'm running into some problems and I'm afraid I've made some bad choices regarding the table design.
In my database I have information on five different kind of users (among many other things). With the exception of two types of users, all of them are very different and have very different kind of information associated with them. Therefore I though it best to put each kind of user in a separate table.
So I have for instance a table called administrators, a table called translators, etc. etc. The problem is that sometimes I end up with a foreign key from some other table. I know the key is for a user but to get the actual user I need to either do some expensive JOINs, or use stored procedures where I can put some logic, etc. etc. Bottom line is that since a user are in one of five tables depending on which kind of user he/she is it's difficult retrieve the information.
I have thus started to wonder that maybe it would be best to keep all users in one big table although there would be many empty columns since many columns are only for one or two types of users.
Anyway, I would like some info and opinion on this - whadda you say?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Create a masetr table as for ur codes and for each typeof user make a row in that table and associate a code for that.
Take another table as access roles and define a role correcponding to a particular role.
ex there are three roles (table master role)
1) admin say code 1
2) superuser say code 2
3) Normaluser say code 3
table 2 access role
uniqueID code
1)gm0013 1
2)sr1235 2
3)us0001 3
3)us0002 3
3)us0003 3
3)us0004 3
now each time take a join with table 2 based on uniqueID(key for ur table)
u'll get code and as per this code u'll give access rights to that logon person.
each time when u want to check user access role scan the user
Regards,
Suyash
|
|
|
|