646 Posted Topics

Member Avatar for indian143

Why don't you use [CODE=VB]MkDir "C:\TempDir"[/CODE] Ok. If you want to do it hard way: [CODE=VB]Private Declare Function CreateDirectory Lib "shell32.dll" Alias "SHCreateDirectoryExA" (ByVal hwnd As Long, ByVal pszPath As String, ByVal psa As Any) As Long CreateDirectory Me.hWnd, "C:\TempDir", Nothing[/CODE] just make sure to check return value for errors.

Member Avatar for Teme64
0
122
Member Avatar for spick

LostFocus event might be better for your purposes: [ICODE]Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus[/ICODE]

Member Avatar for Teme64
0
92
Member Avatar for MichelaDee

First you have to create a new table to your Access DB. You'll find the SQL syntax and samples with a little [URL="http://www.google.com/search?q=sql+create+table"]googling[/URL]. I think that the [URL="http://www.w3schools.com/Sql/sql_create_table.asp"]w3schools.com[/URL] has the simplest examples. And you do know the table's field names and types by looking existing tables. After successfully creating a …

Member Avatar for Teme64
0
93
Member Avatar for ChroNoS

You have to loop the original string: [CODE=VB]Private Function InsertChar(ByVal StringIn As String, _ ByVal CharToInsert As String, _ ByVal InsPosition As Integer) As String Dim NewString As String Dim CharsUsed As Integer Dim i As Integer If InsPosition >= Len(StringIn) Then InsertChar = StringIn Exit Function End If NewString …

Member Avatar for ChroNoS
0
117
Member Avatar for Lumnous

The code won't open a file since it never gets any file name. Try it this way: [CODE=VB.NET]Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then WebBrowser1.Navigate(OpenFileDialog1.FileName) End If End Sub[/CODE] now it may or may not open and show the file …

Member Avatar for Lumnous
0
518
Member Avatar for baburk

Since you have two different Availability values, you'll get two rows no matter what you do. Drop the dbo.RoomRates.Overflow = 1 check. Or use that query as a sub query: [CODE=SQL]SELECT DISTINCT dbo.RoomRates.RoomID, MIN(Availability) As Availability, SUM(RoomTotalPrice) AS RoomTotalPrice FROM (< your original query here >)[/CODE]

Member Avatar for Teme64
0
92
Member Avatar for haven_u

The error message says it all, the argument has to be character: [CODE=VB.NET]strAthleteToken = strRecord.Split(CChar(","))[/CODE] and the [ICODE]strAthleteToken[/ICODE] must be a string array, not a string.

Member Avatar for Teme64
0
99
Member Avatar for Yamachi

In fact you have two different types. One Vertex type in your DLL namespace and another Vertex type in your main program's namespace. Since those are different types you can't do direct assignment. One way to get around "different types" problem could be following: [CODE=VB.NET]Dim VertObj As Object = DirectCast(method.Invoke(o, …

Member Avatar for Yamachi
0
134
Member Avatar for tyserman5674

Use the same handler to handle all three text boxes: [CODE=VB.NET]Private Sub ValidateNumbers(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged Dim ThisBox As TextBox ThisBox = CType(sender, TextBox) If ThisBox.Text <> "" Then If IsNumeric(ThisBox.Text) Then 'checks input for numeric value If CDbl(ThisBox.Text) <= 0 Then …

Member Avatar for Teme64
0
313
Member Avatar for spinnaret

OMG. Can't you fix the sp? Like "SELECT DISTINCT(SchoolChildID)..." or "SELECT DISTINCT(SchoolChild)..."

Member Avatar for Teme64
0
99
Member Avatar for afroz282004

You execute SQL query twice:[CODE=VB.NET] Dim obj As Byte() = CType(cmd.ExecuteScalar(), Byte()) Response.ContentType = "Application/msword" Response.BinaryWrite(CType(cmd.ExecuteScalar(), Byte()))[/CODE] How is your Doc stored in DB? As an image-type field? You may try to change latter cmd.ExecuteScalar to: [CODE=VB.NET]Response.BinaryWrite(obj)[/CODE] since obj should contain Doc-field as a byte array at that point. You …

Member Avatar for Teme64
0
117
Member Avatar for Duki
Member Avatar for Duki
0
111
Member Avatar for Eyo
Member Avatar for 3Dees

ToString() gives the textual respresentation of the object. This means with numbers that, for example, number 3 gets displayd as string "3". ToString() also accepts format string as a parameter and this gives the full power of it. For example -123.ToString("X") returns hexadecimal representation of the number (=FFFFFF85). You can …

Member Avatar for Teme64
0
190
Member Avatar for eng.N

[ICODE]"SELECT [User_Name],[Password],[User_Type] FROM Log_in WHERE [User_Name] = @UserName AND [Password] = @UserPassword "[/ICODE] and then check which User_Type this user has. I won't correct the rest of your code, you can surely do it yourself.

Member Avatar for eng.N
0
191
Member Avatar for sarifah

Here you are: [CODE=VB6] Dim LoanDate As Date Dim LoanDays As Integer Dim DueDate As Date Dim DiffDays As Long Dim Fine As Single Dim Total As Single ' When loaned LoanDate = CDate("8.10.2008") ' How many days can be loaned LoanDays = 3 ' When the loan time ends …

Member Avatar for Teme64
0
102
Member Avatar for cassie_sanford

[QUOTE]i'm getting the graphic from the book's cd--but i'm having all types of problems getting it to copy[/QUOTE] What are all types of problems? You're working with localhost? Your localhost resides on "D:\Inetpub\wwwroot" (this is my computer so your could be "C:\..." or something else). You've created a web-project "local". …

Member Avatar for Teme64
0
167
Member Avatar for hell_tej

Try to also set rs and con to Nothing. You may also get that error from target file i.e. you don't have write permission to D:\Person.mdb or D:\Person.mdb is opened in your application or in some other application.

Member Avatar for hell_tej
0
194
Member Avatar for corteplaneta

You'll get that with ListView control. Fill ListView control: [CODE=VB.NET]Dim TempStr(1) As String Dim NewNode As ListViewItem ListView1.View = View.Details ' FullRowSelect has to be True ListView1.FullRowSelect = True ListView1.Columns.Clear() ListView1.Columns.Add("Column1", 100) ListView1.Columns.Add("Column2", 100) ListView1.Items.Clear() TempStr(0) = "foo" TempStr(1) = "bar" NewNode = New ListViewItem(TempStr) ListView1.Items.Add(NewNode) TempStr(0) = "another" TempStr(1) …

Member Avatar for corteplaneta
0
195
Member Avatar for Kusno

Are you taking course on Visual Basic? AFAIK connecting with RMI or socket has something to do with Java :-O

Member Avatar for Kusno
0
66
Member Avatar for Entropy1024

Assuming you can convert start and ending times to valid dates, use DateDiff with "n" which gives you minutes: [CODE=VB.NET] Dim d1 As Date Dim d2 As Date Dim DiffMinutes As Long d1 = CDate("1.1.2008 23:00") d2 = CDate("2.1.2008 1:00") DiffMinutes = DateDiff("n", d1, d2)[/CODE] gives DiffMinutes = 120. Date …

Member Avatar for Entropy1024
0
149
Member Avatar for pardeep3dec

Here's a snippet from some old prog of mine: [CODE=VB6]Private Declare Function GetComputerName Lib "kernel32" Alias _ "GetComputerNameA" (ByVal lpBuffer As String, ByRef nSize As Long) As Long Public Function GetThisComputerName(ByRef ComputerName As String) As Boolean ' Returns Computer name Dim lpBuffer As String Dim i As Long Const BUFMAXLENGTH …

Member Avatar for Phreak
0
151
Member Avatar for mporter67

Use arrays or collections. Maybe even dictionary might work in that. But maybe a simple array will do (pseudo code): [CODE]Const TotalOptions = 5600 Dim GrossPay(TotalOptions) As Single Dim Deduct(TotalOptions) As Single ' Fill arrays with proper values, GrossPay in increasing order and Deduct with matching index with GrossPay GrossPay(1) …

Member Avatar for jireh
0
123
Member Avatar for sniper1983

You'll get it with: [CODE=VB.NET]Dim Resp As System.Net.HttpWebResponse ' Make WebRequest ' Resp.Cookies has the cookies[/CODE] Take a look at [ICODE]System.Net.WebResponse[/ICODE] and [ICODE]System.Net.HttpWebResponse[/ICODE] namespaces. You should find everything you need in them (and in Request namespaces of cource).

Member Avatar for Teme64
0
170
Member Avatar for Saddi

How about a bit googling [URL="http://www.google.com/search?q="ms+access"+"vb.net"+tutorial"]http://www.google.com/search?q="ms+access"+"vb.net"+tutorial[/URL]

Member Avatar for Teme64
0
69
Member Avatar for spinnaret

In the .NET way: [CODE=VB.NET]If datgridview.item(x,y).value.tostring.substring.Length > 0 Then datgridview.item(x,y).value = datgridview.item(x,y).value.tostring.substring(0, datgridview.item(x,y).value.tostring.Length - 1) End If[/CODE]

Member Avatar for Teme64
0
241
Member Avatar for Tyrone.Wilson

Take a look at [URL="http://sqlite.org/"]SQLite[/URL] and [URL="http://sqlite.phxsoftware.com/"]System.Data.SQLite[/URL] for .NET environment. If you find it useful for your purposes, the freeware version of [URL="http://osenvistasuite.com/"]OsenXPSuite[/URL] is a pretty good database designer.

Member Avatar for Teme64
0
154
Member Avatar for Sheryl99

If your class is part of a windows GUI application you won't even need to import that namespace and your code works. So I assume you're creating a standalone dll. First you have to add reference to System.Windows.Forms.dll. From "Project"-menu select "Add Reference". From ".NET"-tab locate System.Windows.Forms, select it and …

Member Avatar for Sheryl99
0
4K
Member Avatar for Panithuli

[QUOTE]The constructor for the class should set the initial fuel level to 0.0[/QUOTE] Your school assignment states clearly what you should do: [CODE=VB6]Private FuelLevel As Double Private Sub Class_Initialize() FuelLevel = 0 End Sub[/CODE] You can't initialize variables outside of the procedures like smile4evr said.

Member Avatar for Panithuli
0
81
Member Avatar for K.Vanlalliana

If I remember right, the connection string is following: [CODE]"Driver= {MicrosoftAccessDriver(*.mdb)}; DBQ=" & server.mappath("Record.mdb") & "; Uid=Username; Pwd=Password;"[/CODE] One way to use MySQL in VB6 is to get MySQL ODBC driver (from MySQL site). The connection string is following: [CODE]"DRIVER={MySQL ODBC 3.51 Driver}; SERVER=127.0.0.1; DATABASE=MySample; UID=UserName; PWD=Password"[/CODE] You may find …

Member Avatar for Teme64
0
149
Member Avatar for gouki2005

It goes like this: [CODE=VB.NET] Dim comando As OleDb.OleDbCommand() Dim strSQL As String strSQL = "Insert into personaldata (name,occupation,address,phone) values (" strSQL = strSQL & "'" & getname() & "'," strSQL = strSQL & "'" & getoccupation() & "'," strSQL = strSQL & "'" & getaddress() & "'," strSQL = …

Member Avatar for Teme64
0
123
Member Avatar for LottaBajan2

If you mean with keypad those keys on the right side of the (standard) keyboard, just press Num Lock. If you want to do that programmatically, see: [URL="http://forums.devx.com/archive/index.php/t-38468.html"]Turn Num Lock, Caps Lock keys on and off with VB6[/URL] and you will probably forget that keypad thing :D

Member Avatar for selvaganapathy
0
636
Member Avatar for earlwbollinger

[QUOTE]ByVal SFNInvestmentsBankAccountInfo() As SFNInvestmentBankAccountInfoType[/QUOTE] means that an array of SFNInvestmentsBankAccountInfoType should be passed to web method. Also the result is an array: [CODE=VB.NET] Dim myresult() As localhost.ResponseType Dim bankinfo(0) As New localhost.SFNInvestmentBankAccountInfoType . . bankinfo(0).BankAccountName = "ACME Systems Chemical Combine" . . bankinfo(0).versionID = "10001" myresult = wb.createBankAccountInformation(bankinfo)[/CODE]

Member Avatar for earlwbollinger
0
704
Member Avatar for tyserman5674

You may want to check that when user presses Ok-button (or any similar button): [CODE=VB.NET]Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click ' Check empty text If Me.txtInterestRate.Text.Trim = "" Then MessageBox.Show("Please enter interest rate", _ "Missing Information", _ MessageBoxButtons.OK, _ MessageBoxIcon.Warning) Me.txtInterestRate.Focus() ' Set focus …

Member Avatar for tyserman5674
0
163
Member Avatar for Tyrone.Wilson

That's a quite large topic. Normal scope/out of scope rules apply to variables i.e. when (local) variable goes out of scope, it's destroyed automatically. Class implementations should implement destructor (Class_Terminate event) to clean up allocated resources. The same applies to every reference you make to resources, like database connection objects. …

Member Avatar for Tyrone.Wilson
0
105
Member Avatar for Jostra

Have you created streamfilewrite object somewhere? Like this: [CODE=VB.NET]Dim streamfilewrite As FileStream streamfilewrite = New FileStream("<path to file>", FileMode.Open) [/CODE]

Member Avatar for Jostra
0
126
Member Avatar for crbsathy

I think it goes like this with ADO: [CODE=VB6]Datacontrol.Recordset.AddNew 'Datacontrol.Recordset.Fields("<fieldname>") = <value> Datacontrol.Recordset.Update[/CODE]

Member Avatar for debasisdas
0
70
Member Avatar for smile4evr

What error message exactly? Do you have CN open? [CODE=VB]Dim CN As ADODB.Connection CN = New ADODB.Connection CN.Open "<connection string>"[/CODE] Also the recordset could be empty: [CODE=VB]If RS.Fields.Count > 0 Then Label7.Caption = RS.Fields(0) Else Label7.Caption = "" End If[/CODE]

Member Avatar for smile4evr
0
82
Member Avatar for spinnaret

What kind of VB.NET exe and what kind of parameters you have? You could write parameters to a some file and pass the file's name to exe with commandline. If you have only few parameters, put them to exe's commandline. And here's how to deal with cmd-line in VB.NET: [CODE=VB.NET]For …

Member Avatar for Teme64
0
119
Member Avatar for smile4evr

Not sure if this is even close with what you want: [CODE=VB6]Dim strSQL As String Dim oConn As ADODB.Connection Dim Rs As RecordSet oConn = CreateObject("ADODB.Connection") oConn.Open("<conn string>") strSQL = "INSERT INTO <Table Name> (<fields>) VALUES (<field values); SELECT @@IDENTITY AS 'Identity' " Rs = oConn.Execute(strSQL) Print(Rs(0))[/CODE] What it does …

Member Avatar for Teme64
0
264
Member Avatar for guest11
Member Avatar for Teme64
0
107
Member Avatar for mailtosridar

If you don't need to export directly to native xls-file, one way is to use CSV-file: [CODE=VB.NET]Dim OutFile As StringBuilder Dim SepChar As String Dim i As Integer Dim j As Integer OutFile = New StringBuilder() SepChar = "," For i = 0 To DataGridView1.RowCount - 1 ' Columns of …

Member Avatar for Teme64
0
87
Member Avatar for ChroNoS

[QUOTE]one more question, is replace function case sensitive?[/QUOTE] By default, yes. Unless you have [CODE]Option Compare Text[/CODE] Here's an example [CODE]Dim str As String str = "ABC" str = Replace(str, "b", "x", , , vbBinaryCompare) [/CODE]results "ABC" and vbBinaryCompare is the default compare method in VB6 [CODE]str = Replace(str, "b", …

Member Avatar for Teme64
0
217
Member Avatar for Dell XPS

Check My.Application.OpenForms collection: [CODE=VB.NET]Public Function FormsRunning(ByVal FormName As String) As Integer ' Return number of forms with name FormName in this application Dim Count As Integer Dim i As Integer Count = 0 For i = 0 To My.Application.OpenForms.Count - 1 If My.Application.OpenForms.Item(i).Text = FormName Then Count += 1 End …

Member Avatar for Teme64
0
296
Member Avatar for Sheryl99

Yes, there is a way. First, here's a sample Account and Accounts (without any error handling): [CODE=VB.NET]Option Explicit On Option Strict On Public Class Account Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property …

Member Avatar for Teme64
0
4K
Member Avatar for satmad123

Which part is not working? What error do you get? At least using TextBox1.Text in both SET and WHERE seems a bit suspicious. If roll exists, you update roll-field with the same value it already has. If roll does not exists, then your update fails. Also, open connection before you …

Member Avatar for Teme64
0
94
Member Avatar for mugun

What error message do you get? Does this work in your code: [CODE=VB.NET]Dim oConn As OleDbConnection Dim oCmd As OleDbCommand Dim strSQL As String Dim myDate As Date myDate = CDate("4.10.2008") ' Use your locale date format, like "10/4/2008" strSQL = "INSERT INTO <mytable> (<my date field>) VALUES ('" & …

Member Avatar for Teme64
0
99
Member Avatar for JosephGassmann

To open Excel: [CODE=VB6]Sub OpenExcel() ' OpenExcel Macro Shell ("D:\Program Files\Microsoft Office\Office10\excel.exe") End Sub[/CODE] To open Excel with a file: [CODE=VB6]Sub OpenExcel() ' OpenExcel Macro Shell ("D:\Program Files\Microsoft Office\Office10\excel.exe ""D:\My Documents\Countries.xls""") End Sub[/CODE] Of course, modify paths to match yours.

Member Avatar for Teme64
0
109
Member Avatar for laghaterohan

You can set Icon-property from form's properties when the form is in design mode. If you don't see "Properties"-panel, press F4 to open it. To change project icon go to "Project"-menu and choose "<project name> Properties..." and from "Application"-tab change icon from Icon-drop down. To programmatically change form's icon: [CODE]Me.Icon …

Member Avatar for Teme64
0
772
Member Avatar for saat

At least month has to be in upper case. See [URL="http://www.daniweb.com/forums/thread148265.html"]this thread[/URL] if it helps anything.

Member Avatar for debasisdas
0
79

The End.