|
|
oh well, it's already quit late here
but thanks anyway
|
|
|
|
|
I am not sure what I need to do to get this done, so Be nice.
First off some background Info
I am creating a Class in a Windows Scripting Component File (.WSC), that will connect to a DB and run Querys for me.
Then I will use a Vbscript and reference the WSC file to it, and call the functions.
On my Script, I will call the Function OpenDBConnection() (which sets up the connection to the DB).
How do I pass the connection from OpenDBConnection to the Function GetSomethingDone() from the script that called OpenDBConnection()
Class SQLDBQuery
Private objSQLConn
Private Sub Class_Initialize
Set objSQLConn = CreateObject("ADODB.Connection")
End Sub
Public Function OpenDBConnection(strDomainController)
Dim strDBPath
strDBPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDomainController & "netlogon\user.mdb"
objSQLConn.Open strDBPath
Set OpenDBConnection = objSQLConn
End Function
Function GetSomethingDone
Do something Here....
End Function
End Class
Private objSQLDBQuery
Set objSQLDBQuery = New SQLDBQuery
Function OpenDBConnection(strDomainController)
Set objSqlConnection = objSQLDBQuery.OpenDBConnection(strDomainController)
Set OpenDBConnection = objSqlConnection
End Function
|
|
|
|
|
Just to Update the Code in the post is from the WSC file.
|
|
|
|
|
Hi,
I am usiung Vb.Net 1.1 and i need to draw a Rhombus can any one help thanks.
Mohammad Al Hoss
|
|
|
|
|
The DrawPath method on the graphics object passed to a PaintEvent will draw any shape you like.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey, assuming you're the one who voted my answer a 1 - my answer is correct. If you're incapable of understanding it, try asking me some more questions, so I can try to help you further.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is there a way to disable the close button in the upper right corner of a form? I know how to get rid of the minimize and maximize, but I would like to disable the close button as well.
Any help would be greatly appreciated.
|
|
|
|
|
Hi,
go to the form properties window and set the control box to false,
and u can check the other properties like maximize and else.
Mohammad Al Hoss
|
|
|
|
|
|
|
Can anybody help me out, i want to develop code for chatting in lan. means i will supplies ip adrees to whoem i want to send the msg.
if any body have any idea pls reply
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Hi Yogesh,
Refer to the following links:
http://www.codeproject.com/KB/cs/LanChat.aspx
http://www.codeproject.com/KB/IP/ChatMasala.aspx
I hope this would be helpful.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hiii
I sending a sample code for send msg in Lan.
If lstnames.SelectedItems.Count > 0 Then
For Each strSeleted As String In lstnames.SelectedItems
'somehow a list item is in fact a string
Dim strname As String = " " & strSeleted
Dim lngPos As Long = 1
Do
Dim lretval As Long = Shell("net send " & strname & _
" """ & Mid(strMessage, lngPos, iChunk) & """", vbHide)
lngPos += iChunk
'pause to stop out of sequence message chunks
Sleep(100)
Loop Until lngPos > Len(strMessage)
strStatus &= strname.ToString
Next strSeleted
End If
Your LAN messanger setting on Your computer must be enable for run this code.
May be this code helps U.
Thanx
Mitesh Khatri
khatrimitesh@hotmail.com
|
|
|
|
|
Hi all
I am trying to translate reports (.rdlc files) from english into well, for starters, Portuguese. The program these reports work for, written in Visual Basic, already has a translation function that works - it translates the program fine - by passing it the string to be translated and it returns the corresponding value from a textfile recompiled to .resx . The program checks what the system language is, and accordingly selects the appropriate resource file.
My question is this - how do I translate these reports?
|
|
|
|
|
Hello all,
I've just installed a copy of VS2008 Standard, and I'm looking at the MicrosoftReportViewer, and the ability to design a new report from it. To get started with it, I'm using the wizard.
What I'm finding is that the report doesn't display anything (data), although it is displaying the header text, and field names.
The way I'm firing the report is via a button on form MultipleLicenceResponse.vb. This form has a DataGridView (dgvResponseData) on it, which gets its data from tblResponseData.
This is opening LicenceReportPreview.vb via ...
Dim frmReport As New LicenceReportPreview
With frmReport
.Licence = "Display anything in this field for now"
.LicenceTable = tblResponseData ' Just to see if I can access this instead - which I can't!
End With
frmReport.ShowDialog()
The report wizard gets its object data from the LicenceReportPreview.vb class, where I'm selecting the LicenceReportPreview as the object and, for now, just the Licence property (which should be the string, "Display anything in this field for now") .... just to get something on the report!
What am I missing? Does anybody know of a good tutorial that I can follow which shows me how to get the contents of my table onto the report?
|
|
|
|
|
Check box column getting unchecked when I am sorting column in datagridview.
Can any one can help me?
Regds.
Suman
|
|
|
|
|
Hello Suman,
I have checked this and it works fine for me. Could you please provide us a small
sample application showing the mentioned behavior.
Regards,
Allen
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Imports System
Imports System.Data.SqlClient
Public Class Form1
Dim str As String
Dim con As SqlConnection
Dim da As SqlDataAdapter
Dim ds As New DataSet
Dim dt As DataTable
Dim dv As DataView
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
str = "Integrated Security=SSPI; User Id=sa;Initial Catalog=MAS08; Data Source = suman"
con = New SqlConnection(str)
con.Open()
str = "select * from unitmaster"
da = New SqlDataAdapter(str, con)
da.Fill(ds, "unitmaster")
dt = ds.Tables(0)
dv = New DataView(dt)
Dim colCheckbox As New DataGridViewCheckBoxColumn()
' Size the column width so it is wide enough to display the header
colCheckbox.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader
colCheckbox.ThreeState = False
colCheckbox.TrueValue = 1
colCheckbox.FalseValue = 0
colCheckbox.IndeterminateValue = System.DBNull.Value
colCheckbox.DataPropertyName = "Checkbox"
colCheckbox.HeaderText = "Checkbox"
colCheckbox.Name = "Checkbox"
'colCheckbox.ReadOnly = True
dgv.Columns.Add(colCheckbox)
dgv.DataSource = dv
End Sub
End Class
|
|
|
|
|
Hi all
Please help!
How to write filter by date in macro in Excel?
Automatic generated macro looks like this:
Selection.AutoFilter Field:=10, Criteria1:=">=01.01.2007", Operator:=xlAnd, _
Criteria2:="<01.01.2008"
But this macro is not working.
Thanks
|
|
|
|
|
Hiiiii
Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _
Criteria2:="<#01.01.2008#"
and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy"
For the comparison with Date use the # character. May be this solve your problem.
Thanx
Mitesh Khatri
khatrimitesh@hotmail.com
modified on Wednesday, June 11, 2008 7:26 AM
|
|
|
|
|
Unfortunatly its not working too
|
|
|
|
|
I have a function that sometimes takes quit a while to run (always the first time)
It simply opens a crystal reportviewer, loads the report , reconnects it and sets printer and page settings.
This doesn't take but a second or so the second time you open up the crystal report viewer but the first time apperantly it does.
So now I want a small animated waiting form to be displayed while this is running.
But when I put a progressbar on it (as animation) the progressbar is frozen (put it to marquee so should be running continuasly)
I know this is because of threading (the animation form is on the same thread as the code to open the report) but there is simply no way for me to put the code for opening the report in a seperate thread.
So I try'd putting the form in a seperate thread but that didn't help (no big surprise there but I was desparet)
My last thought is to put the progressbar (or whatever animation that eventually ends up there) in a seperate thread, but I can't seem to get that working (probably not possible)
Is there any way to make the animation (progressbar / gif / ...) on the waiting form to work even when the gui threat is hanging?
With thanks for any help
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
hi,
i have written a code to connect to sql server 2005 database and
do some update and insert operation, i want to handle an exception, such
that whenever the connection to the database fails, the program should
wait for the connection to be available and reconnect..
constring = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=pwd;Initial Catalog=db;Data Source=pc1"
Try
cn.ConnectionString = constring
cn.Open()
Catch ex As Exception
Err.Clear()
System.Threading.Thread.Sleep(300000)
' cn.Close()
' cn.ConnectionString = constring
cn.Open()
End Try
End Sub
it does not seem to work, please help
asfdasdf
|
|
|
|
|
vermaratan wrote: Err.Clear()
What is Err?
vermaratan wrote: System.Threading.Thread.Sleep(300000)
Why are you waiting for 5 minutes?
vermaratan wrote: cn.Open()
If it failed the first time, what makes you think it will work again?
What is the exception? That will tell you why it failed.
|
|
|
|