Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

VB Command Syntax Website

Here is a good link for VB Command Syntax for our newer members

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Command Button To Open The Website...
Dear Friends,

What should be the code for a command button which opens a website ( when it is pressed.

Hope to get help.



Take To Website On Command Button Click && Sounds Help
how do i direct someone to a website when they click a button? can anyone help?

plus, how can i play a sound? for example, when the timer runs out, a sound plays until they click an OK button

How To Link Any Label Or Command Button To Any Website
Hi all
I want to link a label or command button to a particular web page
What is the method for it?
Can any one send me itís coding.
Miss I want that when I click on any command button at my form then it open the website
Help me

Code To Link Website To Command Button
I am looking for the line of code to link a website to a command button in ms access, using vb.

Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/, application/, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever

But when I used the website as the domain to see if code mdified the headers or not, it directed me instead to just How would a browser request information to

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

Launching A Website Or Another Type Of File From A Command Button
How can you launch a website... say "" in the default browser from a command button...

I tried this...

Private Sub cmdGYID_Click()
Dim X
X = Shell("", vbNormalFocus)
End Sub
but it just spits out an error... so I guess this only works with EXE files

Ado Command Syntax

I've got the following procedure

Dim strSql As String

Set Cmd = New ADODB.Command

strSql = ("select(select description from tblcitizenship where
citizenid = tblTenant.citizenid) as citizen, tbltenant.* from tbltenant where tbltenant.idnumber like ?")

With Cmd
.ActiveConnection = Cn
.CommandText = strSql
.CommandType = adCmdText

End With
Cmd.Parameters(0) = InputBox("Enter Surname ", "Find by Surname")
Set Rs = Cmd.Execute

pse note strsql - I would like to search for idnumber like eg %123%, but I don't know how to change the ? Paramater



Open A Website On Clicking A Command Button In VB 6.0 Windows Application
Hi I have developed a windows application using VB 6.0.
When the application is run for the first time a License activation Form pops up with a Command button Activate.
All i want is to open a web site for registration when clicking the Activate button.Can some one tell me how to achieve this.Thanks

SHAPE Command Syntax
** Never mind, I stumbled across it **

this way works in case someone else needs it. I left off a set of parentheses.

strSQL = "SHAPE {" & strSEL1 & "} AS cmdCats " & _
"APPEND ((" & strSHAPE2 & " AS cmdSub )" & _
"RELATE 'Category_ID' TO 'CategoryID') AS cmdCatSub"

original question:

I'm trying to generate a shape command that will shape the data from 3 tables-- Table1 relates to Table2, Table2 relates to Table3. I understand how to relate 2 tables, but what is the syntax for multiple tables:

this works by itself--
strSHAPE1 = "SHAPE {" & strSEL1 & "} AS cmdCats " & _
"APPEND ({" & strSEL2 & "} AS cmdSubs " & _
"RELATE 'Cat_ID' TO 'SubID') AS cmdCatSub"

and this works by itself --

strSHAPE2 = "SHAPE {" & strSEL2 & "} AS cmdSubName " & _
"APPEND ({" & strSEL3 & "} AS cmdParts " & _
"RELATE 'SubID' TO 'SubCategory') AS cmdSubParts"

I've tried variations of this to relate all 3, but nothing seems to work --

strSQL = "SHAPE {" & strSEL1 & "} AS cmdCats " & _
"APPEND (" & strSHAPE2 & " AS cmdSub " & _
"RELATE 'Category_ID' TO 'CategoryID') AS cmdCatSub"

strSEL1 = "SELECT Cat_ID, CatName FROM Categories ORDER BY Cat_ID ASC"

strSEL2 = "SELECT SubID, SubName, CategoryID FROM SubCats ORDER BY SubID ASC"

strSEL3 = "SELECT * FROM Parts ORDER BY [Size] ASC"

Could someone show me the correct syntax for relating multiple tables this way? Thanks

What Is The Syntax Of The Load Command?
What is the syntax of the load command in VB6 Pro, I am trying to make a control array but I don't know the proper syntax for it to make it work.

Shell Command Syntax
I'm using VB4 and writing a small "Loader" program that will enable the user to choose which software etc to install on their PC from a CD.

The software will be located in different folders on the CD - eg Prog1Folder, Prog2Folder . . etc,. etc.

Since the user's drive letter will not be known, I've already got a routine that stores the relevant drive letter in a variable - "aCDdrive". Eg " E: " (without the quotes)

I need some help with the syntax for Shell - when the path is stored in a variable.

The idea is that pressing a particular command button gives me "shell aCDdriveProg1FolderSetup.exe"

Alternatively, a selection of Check Boxes may be preferable - and the routine runs down installing all the software that is ticked - one after the other.

Could anyone help me with this syntax. Many thanks, Malcolm

Find Command Syntax
I have created a user interface using visual basic 6, each file or account has basic information name and address and so on. I have also created a table to access all the files, and add a new file to the end of the list with unique account number. My problem is I want to also create a command button to find a specific file by seatching any field in the account say I want to search all the files that contain in first name JOHN or last name as JONES, and all the files would come up in the search or displayed in the search.

I don't want to use dialog boxes to ask this question, my approach must be as follows, clear the screen first, a find button will appear on the screen, and then the user will type in the first name field say JOHN and then click the find button, and that record should be displayed and if it doesn't exist then there should be an error. I guess my problem is how do I do this just like the commands in the ado file in the access. I have tried using the connection between the text entered and comaring it to the recordset's data, which I had no sucess.

I need your help
Thank you

Loast A Command Syntax...??!!
hi all,

 I know this sounds really strange... but I "lost" the "Left(string, #)" command..!
 Mid(string,#) and Right(string,#) work properly, and as I start writing "left(" I get the suggestion label, but this does not happen for Left(ssss,#).

 Does anybody have a clue as of how this may have happened..? Or rather, how can I solve it??!!




Edited by - flyingtoaster on 11/21/2005 4:18:27 PM

Command Line Syntax
Hello all,

I am trying to to get this to work but it is complaining aout the syntax of this line. I am trying to execute this command from the Command line

C:> copy C:Excelp.xls C:Program Filesp.xls

it is complaining about the space between Program and Files. Is there a way o solve this problem. I want to copy some files to Program Files folder, but the space character between the two words is causing the problem. Any ideas?

Shell Command Syntax
I am having trouble with some VB syntax. I would like to pass a variable to the Shell command for NET SEND as follows:


I have tried a few variations of quotation mark placement with no luck. Is this possible to achieve in this case?

Syntax Error In INSERT INTO Command
Hi everyone

Im working on my capstone project and run into a problem that I cant wrap my head around. When trying to update a database I get a generic OleDb exception and find "Syntax error in INSERT INTO statement" in my watch window.

I have several functions which update different tables in the database using almost the same exact code (only names and variables change) and they all function fine.

Ive found responses to similar problems, but with the differences in their structure (and my relative inexperience) I cant really adapt them.

Here is the problematic code
Private Sub AddNewInvestment()
'this procedure creates a new investment in the Stocks table
Dim newDataRow As System.Data.DataRow

'create the new row with the same layout as tblStocks
newDataRow = DsInvestment1.tblStocks.NewRow
newDataRow.Item("Company") = gblCompany
'newDataRow.Item("Price") = gblPrice
'newDataRow.Item("PurchasedDate") = gblDate
newDataRow.Item("Commission") = gblComission
'newDataRow.Item("Value") = gblValue
'newDataRow.Item("Shares") = gblShares

'add the new row to the dataset
'update the database file

End Sub

The INSERT INTO statement
(Commission, Company, Price, PurchasedDate, Shares, Value)
VALUES (?, ?, ?, ?, ?, ?)

Also in the watch window I see
Company "asd"String
HasErrors TrueBoolean
Item<cannot view indexed property>Object
Item<cannot view indexed property>Object
Item<cannot view indexed property>Object
Item<cannot view indexed property>Object

Heres one of the ones that work
Private Sub AddNewCheckingAccount()
'this procedure adds a new checking account row to tblCheckingAccount
Dim newDataRow As System.Data.DataRow

'create the new row with the same layout as tblCheckingAccount
newDataRow = DsCheckingAcc1.tblCheckingAccount.NewRow
newDataRow.Item("Bank") = gblBank
newDataRow.Item("Owner") = gblOwner
newDataRow.Item("AccountNumber") = gblAccountNumber
newDataRow.Item("Balance") = gblBalance
newDataRow.Item("InterestRate") = gblInterest

'add the new row to the dataset
'update the database file
End Sub

And the working SQL
INSERT INTO tblCheckingAccount
(AccountNumber, Balance, Bank, InterestRate, Owner)
VALUES (?, ?, ?, ?, ?)

Im really pretty stumped on this. It doesnt make sense why one would work and the other wouldnt with nearly identical code.

Other info
VB.Net 2003
No permissions set on my .mdb file.
Im able to retrieve info from the table just fine

Any help you could give would be great


Application Syntax? {command Line Parameters}
Is it possible to add syntax to vb program? Like, if I wanted a program to run at startup, I'd want it to go to the tray. C:myprogramprogram.exe -t
when -t = tray


Syntax Error Near "Value" SQL Insert Command
I having syntax error near the insert command of SQL...

Set rs = gConn.Execute("INSERT INTO tblItemCode Value ('" + cmbFITypeID.List(cmbFITypeID.ListIndex) + "','" + iCode + "','" + txtAccType.Text + "','" + txtTypeID.Text + "','" + cmbFrequency.List(cmbFrequency.ListIndex) + "','" + cmbTag.List(cmbTag.ListIndex) + "','" + txtTot.Text + "','" + txtSPTF.Text + "','" + cmbVarTag.List(cmbVarTag.ListIndex) + "','" + cmbSPTFTag.List(cmbSPTFTag.ListIndex) + "','" + txtParentID.Text + "',effDate,effDate,effDate,effDate,55555,effDate,effDate)")

Need help plz... any mistake between above code?

Convert SQL Server SQL Syntax To MS Access Syntax
How can I convert SQL server SQL syntax to MS Access Syntax?
What is the differences, are there any conversion classes or modules I can
I never used any SQL functions, just SELECTing, INSERTing, DELETEing and UPDATEing
and just the SQL function to get the latest added row, but that is not really a problem, I'll should be able to sort that out.

Thanx in advance

Edited by - NLategan on 7/11/2004 9:15:21 AM

Any One Help Please ! VB Syntax Or Crystal Report Syntax Problem Help Please !
Hi friends,

 First I will say what I am trying to do.

     When I Choose the Itemname from two combo boxes
The report shows the Item details for the Items Between the two combo boxes.

There are two combo boxes CmbFrom and CmbTo
I am also passing the date here in the textbox txtfrom and txtto and assigning fdt=txtfrom.Text and tdt = txtto.Text
I face a problem, when I write the code like below. kindly clear me,

        dim sf as string
Private Sub cmdPreview_Click()

 sf = "{Stock.ItemCode} Between '" & cmbFrom.Text & "'and'" & cmbTo.Text & "'" & "AND" & "{Sales.InvDate} in Date(" & _
 Format(fdt, "YYYY,M,D") & ") to Date(" & _
 Format(tdt, "YYYY,M,D") & ")"

End Sub

it shows the error like this 'Error in formula <Record Selection>' "The remaning text doesnot appear to the part of formula".

instead of this when I write the code as below

Private Sub cmdPreview_Click()

 strsf = "{Stock.ItemCode} in'" & cmbFrom.Text & "' to '" & cmbTo.Text & "'" & "AND" & "{Sales.InvDate} in Date(" & _
 Format(fdt, "YYYY,M,D") & ") to Date(" & _
 Format(tdt, "YYYY,M,D") & ")"

End Sub

the report is showing the correct value whe I choose the very First Item in the cmbFrom combo and last Item in the cmbTo comb, but when I choose a Item in the middle order from CmbFrom and CmbTo combobox
it is not showing all the items between the two combo box. it shows only the one item which I choose in CmbFrom combo box. but i need to show all the Items in report between the two combo boxes.

Kindly correct me the code or suggest me how to execute it, or if there is any other way kidnly reply.

Thank you very much,
Thank you very much,


<B><font color="#008000">HAVE A NICE DAY !</font></B>

Edited by - chs on 2/5/2003 4:19:35 AM

Project Properties, Make/Command Line Args Vs Command
When setting the Project's Properties, on the Make tab, in the Command Line Args area, if I put a file's PathName and run it, there are no quotes Chr(34) around it. When I run the app from the IDE it works and copies/moves my file. When I pass a file's PathName via drag/drop, command line or Send To menu, I get quotes and the copy/move fails.

I've parsed the Chr(34)'s out of the strings, but am curious if this will affect other OS's in different ways? I'm developing it on XP, and will be running it on an ME and a 98SE machine as well.

Any thoughts?



Get IP Of Website
i wanna get the ip of a wweb site, im using port 8080, basically, i was wanting the winsock to connect to the site so i could then get the remote ip of the site, heres my code

Private Sub Command1_Click()
Winsock1.Connect txtURL.Text, txtPort.Text
End Sub

Private Sub Form_Terminate()
End Sub

Private Sub Timer1_Timer()
Me.Caption = "URL Open - " & Winsock1.State
End Sub

Get Website Ip
this may be a simple question, but im new so i dont know. and im sure its been asked before. but i want to be able to get a websites ip when i type the address in.
can anyone help me with what the code might be to get the websites ip?

Getting A Website
to get a website you gotta connect to a network or something and type


but what do i connect to? how do i connect to my own internet? what port?

i'm sorri, kinda new with winsock

I know how to run a program in VB, by doing like
shell "Notepad.exe", vbmaximizedfocus

but how would you go about starting up a webpage though for say

greetings all

how can i insert my vb program onto a webpage?

any help would be appreciated



Can i make a code that can make a website using a visual basic

I'm trying to make a website appear according to a web address typed into a textbox. I'm not really sure where to start. I'm actually trying to add it onto a program that's allready made as a conveince. Thanks for any help.

If I made a website, say, on, and as I made it I know the names of the textboxes. Could I open a webbrowser control in visual basic and change the value of the textboxes on my website, or recieve the values from them? I dont really want to do the whole thing on freewebs using vbs, beacuase I would prefer to do it in vb6. Thankyou.

How To Hit A Website URL?
Is there any way I can easily 'hit' a URL? For example, I want my program to "go to"

Any help? Thanks!

Website In Vb
Hey guys,
I want to have a vb program with 1 textbox and 1 command button. The Textbox I want pointed The search box on and when I hit the command button on the program I want it to search. Without seeing google or anything how would I connect VB to Website textboxes and buttons?

hi, i will like the internet explorer that is in my program to show a webpage but a specific line, from line 4 to7...

how do i do that?


VB6 And My Website
Can I create an application that will dial a modem in VB6 and Build a website then inside the website run the application?

Going To A Website
so i have the user inputing what website they want to go to. now i need vb to bring up the default browser and go to the website they wanted.

Don't Know Website
I know this is not the right forum to stick this in, but I have no clue anywhere else I can put it.

Basically, I want to credit a website, but I forgot the web address. However, I have a logo of the website from one of their tutorials.

Would anyone have any ideas what is the website?

Thanks for any replies in advance!

Hey im new to visual basic 6, and i was woundering how would i get a website to load on the form? could sumone give me an example so i know how to do it, thanks.

Log Into Website
how can you like set the details 2 log in2 a site? and then carry on doing whatever ur program does?

Log Into A Website
Hey. What code would I used to log into a website that uses method="POST" from vb6?

who knows that any website can download source code for reference..............i m the beginner or . dont know how to program.

Run A Website
How can I run a link from a program?

Help Me With My Website!

This is my website.

I would like to know 2 things.

1.)Does it look nice?
2.)Does it match the picture I u/l'ed

If either is false please give me a
way to fix it =)

My Website
hehe, sorry people. i forgot to upadate all the files for the website! well its fixed now. go check it out.


I created a website.
Now I need to put it
on the web. And my
website service sucks.

Whats the best one? (free)

Can any one tell me if there is a web site where i can find some informaiton on Data Reports

Iím really embarrassed to ask this question. Itís so stupid, but I canít find it. Iím trying to open an website in the default web browser. Could anyone help me please?

How can I copy a website exactly the way it is so that I can run it even when I am not connected to the internet.

The site that I a copying has alot of gif and stuff.


My New Website
I know that I shouldn't be posting this here... but I want some feedback on my website. I want some people to check it out, then send me feedback. I know that people might use this thread just to get their post counts up (I don't see why they need a high post count), so I'll delete the thread after I get some feedback. Please don't post unless you have somthing usefull to say, since your post count will go down once I delete this thread anyway.


Help Website For VC++?
Does any one know any website for VC++ as in VBCITY.COM?. Thanks

Website And Vb6 App
Hi Guys
Could any one please explain to me how I would go about the following. I haven't done this before and need advise. How do I start?

I am launching a web sit soon and I would like to have an option for downloading an application I have built.

1)Where do I put the application? There is two folders. Private and Images.
2)If I have a page with the word DOWNLOAD, how do I link it to the application.
If there is more to know please put me on the right path


Edited by - pieterw0 on 3/15/2005 9:19:20 AM

Copyright © 2005-08, All rights reserved