|
kingascona wrote: I am writing a VB 6 program that shd run on the network. A user has to login before using the program. Now, I want to prevent multiple user login using one user account. It shdn't allow or prevent a user to login whilst his/her account is in use(the same Cafe Timer Login.
You have to track the user logins AND logouts. When the user attempts to log in, you're code has to check to see if the ID is already logged in and, if so, deny the new login until the old login is logged out. You'd normally track this data in your database users table, or some other session tracking table.
But, there's a catch. What if the user's machine crashes and is forced to reboot without logging out of your app? You need some kind of tool that can clear the now-stuck login. Say the last login was 30 minutes ago, but there hasn't been any activity for the last 15. You need to be able to detect and idle session and automatically log it out at some point. Or write some other tool that an administrator can use to clear the login. Otherwise, the user who had to reboot their machine without properly logging out will never be able to log back in.
|
|
|
|
|
I am able to use SQL commands to access any table & any columns in MS access (or in Excel) table. However, when I try to search columns with spaces (ie: Employee IDNumber, Employee Name, ...) then I have errors
If I change to Employee_IDNumber, Employee_Name then it is OK
<br />
Dim m_sModification As String = "UPDATE [Table Name$] SET Employee_Name = 'Jonny White' WHERE Employee_IDNumber = '12345678'"<br />
<br />
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConnection1)<br />
conn1.Open()<br />
But I have the MS Access (or Excel) tables having Column Headers with spaces between, I try to avoid changing all of them with xxxxx_xxxxx
Do we have other ways to deal with this issue?
Thank in-advanced
modified on Thursday, April 3, 2008 10:34 AM
|
|
|
|
|
You have to enclose and table names and columns with spaces, or names with the potential to have spaces, in square brackets ([]). Like this:
UPDATE [Table Name$] SET [Employee Name] = 'Jonny White' WHERE [Employee IDNumber] = '12345678'
But, keep in mind that having spaces in table and column names is considered bad practice. Avoid doing this if at all possible.
|
|
|
|
|
Hi Dave,
It works! I am awared of your comments, however the existed files that has columns with spaces being done long time ago & I am not allow to remove spaces
Many thanks
|
|
|
|
|
Hello everyone...i need some help!!!
I am currently working on a project and have stumbled across a problem. I wish to display data from a database into a combo box on a VB.net form. I can add data on forms that saves in the database but you cannot view the newly entered data in the combo boxs on the VB forms. Is there a code that refreshes the database connection every time new data is entered on the VB forms? Note that the data i wish to display in the combo box is entered on a seperate form on VB.
|
|
|
|
|
You have to reload it by clearing it, and then running whatever code you loaded it with before. Loading a combobox with database data via a connection doesn't keep that connection open and refresh on its own. You essentially grab a copy of the data and hold onto it on the screen. So if the data changes you have to hit the database again to see the new data.
Hope this helps.
|
|
|
|
|
If you have updated data that is reflected in a ComboBox, then you have to re-fetch that data to get it into the ComboBox. Depending on who you fetched that data and bound the ComboBox to it the first time, all you should need to do is run that code again to re-fetch the new data.
|
|
|
|
|
i am working on word macro in which i have to select few heading1 complete content and paste it into other document.
In the document in every heading 1 i have placed bookmarks for start and end . So how to pick up the text .
Private Sub CommandButton3_Click()
Dim a As String
Dim iCnt As Integer
a = ""
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 1")
Selection.MoveDown Unit:=wdWindow, Count:=1, Extend:=wdExtend
'With ActiveDocument.Select
'With Selection.SetRange Start:=Selection.Start, End:=ActiveDocument.Content.End
Dim Label As String
Do While Selection.Find.Execute
With Selection.Find
fndrepl "<#T"
If .Find.Found Then
iCnt = .MoveEndUntil("#>")
If iCnt = 0 Then
MsgBox "No closing tag found", vbOKOnly, "Error..."
Exit Do
End If
.MoveRight wdCharacter, 2, wdExtend
a = Selection.Text
End If
End With
Loop
End Sub
|
|
|
|
|
how to encrypt the connectionstring tag and other tag wen needed in the appconfig file ..how an app.config file is encrypted.
|
|
|
|
|
You don't encrypt the app.config file. You encrypt the values of your sensitive tags, like a ConnectionString. Read this[^].
|
|
|
|
|
hi all
iam making a project in which i have to read 5v(logic 1) from one pin
of parallel port and then from second pin,then measure the time
interval between them.Then i have a fixed distance and so have to
calculate the speed.
Please help me how to write the code and should i write in vb??.
|
|
|
|
|
Read this[^] little article here on CP. The code is written in C#, but is easily translatable to VB.NET.
|
|
|
|
|
Hi Friends,
Kindly help by giving some guidelines reg. sending mails from Visual Basic 6.0.
Thanks & Regards
|
|
|
|
|
It's simply amazing what you can find with a little application of Google.
"vb6 send email[^]"
|
|
|
|
|
Hi,
Currently I have a textfile with each line of text corresponding to a specific format.
Eg, the first 3 characters is an ID and the next 8 characters is the phone number
XXX12345678
YYY23456789
Are there any classes within .NET that will enable me to input the format for the lines (3 char ID, 8 char number) and parse each line into an array of strings, or better still, an array of objects?
Thanks!
|
|
|
|
|
r u saying u want to put id n the phone number in one field?
|
|
|
|
|
It's more like:
I have a text file, and each line in the file is formatted in a specific way.
In the example I gave, for each line, the first 3 digits is the ID, and the next 8 digits is the phone number. Was wondering if there are any classes that enable me to specify this format and just pass in each string read from the file in a loop so that they can be "tokenized" according to the format.
|
|
|
|
|
i don't know wether this going to help u bcoz i'm not doing a text file. in my case i want a document number in this format = <yyyymmdd><custid><running number="">
so i get this doc number = 20080403abcd0001
the coding would be like this.
cmd.Parameters.Add(New SqlParameter("@docNo", SqlDbType.NVarChar, 50))
cmd.Parameters("@docNo").Value = System.DateTime.Now.ToString("yyyyMMdd") + CustID.Text + GetRunNo().ToString("D4")
sorry if this not going to help u bcoz i'm new in this.
|
|
|
|
|
Stop with the txt speak. You've got a full keyboard in front of your and you're not getting charged by the character to post anything. It's very annoying and making your posts hard to read when you do this.
|
|
|
|
|
You can use regular expressions to parse this kind of thing.
|
|
|
|
|
Thanks, just what I was looking for!
|
|
|
|
|
How to Bind Controls in GridView in VB.Net or C#.Net (Windows Application)
Can any help me to sort out this..
|
|
|
|
|
Hi,
u can do it using below code.
Note: ds means DataSet
If ds.Tables(0).Rows.Count > 0 Then
GridView1.DataSource = ds.Tables(0)
Else
MsgBox("No data found!!", vbCritical + vbOKOnly)
End If
ds.Dispose()
cheers!!!!!!!!!!
regards,
Rana Krishnraj
|
|
|
|
|
Hi Rana,
I want to bind Controls say Textbox in DataGridView by firing the click event of command button
Regds
Krish Vignesh
|
|
|
|
|