|
Hello,
I have imported Windows Script Host in my project, because of the CopyFolder() function. But, is my program legal when i have imported Windows Script Host (IWshRuntimeLibrary) and can i still distribute it?
(Maybe someone of Microsoft could answer this question?)
Thanks in regard,
--Zaegra--
|
|
|
|
|
Hi Zaegra,
a. That is not a VB programming question, so you might have better luck on a different forum.
b. If you feel someone from Microsoft is best equipped to answer you question, ask them, not us.
c. As a general rule of thumb: if your application will make people buy MS Windows (because that is the only environment your app will run in), the Microsoft people don't complain. (I'll deny everything if you get pulled into court though)
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
hello frnds,
i have a big code in vb and i just want to convert that code in vb.net
is there is any site,which is do the conversion directly..
or isthere is any way to convert the whole code in to vb.net
regards,
koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
There is no site to do this. It's built into Visual Studio .NET. All you have to do is open the VB6 project's .VBP file to start the conversion wizard.
It will NOT do a perfect conversion. It's simply impossible to get everything correct. I HIGHLY recommend just rewriting the project from scratch, or doing the conversion and rewriting the project piece-by-piece.
|
|
|
|
|
Hi Everyone:
Thanks to Guffa and Dave Kreskowiak, the light of understanding finally broke through the fog in my head about the mechanics of the DataSet.
While exploring the internet trying to find some examples on the use of datasets and so forth I came across an artical saying to set the Autoincrement seed to zero and set the AutoincrementStep to minus one.
As I understand it records written to the dataset from the database will have positive numbering and new records added to the dataset will have negitive numbering.
So if I understand this right data returned from the database will look like:
1 Record 1
2 Record 2
3 Record 3
.
.
.
And new records appended to the dataset will look like:
-1 Record 4
-2 Record 5
-3 Record 6
.
.
.
Does anyone know the link to this artical? I spent a few hours yesterday afternoon trying to locate the artical, but I couldn't find it.
Thanks,
Quecumber256
|
|
|
|
|
Hi, I'm writing a MS Access app for a client, and using the Send Object from DoCmd works fine in sending email. The issue here is, I want to be able to have certain options already checked off so the user doesn't have to do it every single email. For example, I would like 'high priority' already clicked, 'request read receipt' already clicked, and to be able to automatically set a 'reply to' email. Is this possible with the DoCmd call, or should I be looking elsewhere to help with my emailwing woes?
-
reegan41
-- modified at 9:09 Friday 25th May, 2007
|
|
|
|
|
You know how on some websites..say if you're filling out an application that is flash driven or something, that as you go through the different screens (or steps), there are tabs at the top with a label briefly describing what that step is. So for example, when you're purchasing something online, and the first step is putting it in your 'shopping cart' in a tab at the top of the screen or whatever, then when you go to the next screen, the next tab would highlight and say 'payment method', then at the next screen, the following tab would highlight and say 'billing address', etc.
Long story short: is there (that you know of) an ActiveX (VB) control that would allow me to utilize this kind of object within MS Access?
-
reegan41
|
|
|
|
|
hi
I want to use the crystal report in my application on the basis of dataset.
I have done it with dataset having single table but having this error with more than one table :
"Query Engine Error"
Here is the Code:
Dim DS As New DataSet
Dim Cnn As New SqlClient.SqlConnection
Dim DA As New SqlClient.SqlDataAdapter
Cnn.ConnectionString = "data source=sofsrv02\development;" _
& "initial catalog=Northwind;persist security info=False;" _
& "user id=sa;Pwd=;workstation id=aliraza;Pooling=false;packet size=4096"
Cnn.Open()
DA.SelectCommand = New SqlClient.SqlCommand("Select A.PRODUCTID,A.PRODUCTNAME,B.SUPPLIERID,B.COMPANYNAME from SUPPLIERS B,PRODUCTS A WHERE A.SUPPLIERID=B.SUPPLIERID", Cnn)
DA.Fill(DS)
Dim oRpt As CrystalReport1 ' create new report object
oRpt = New CrystalReport1 ' create new instance of the report object
oRpt.SetDataSource(DS) ' set the reports data source
CrystalReportViewer1.ReportSource = oRpt ' set the viewers report source
It executes all the code but finally give me error.
Kindly Solve this Problem
Regards
Ali
|
|
|
|
|
hi,
What type of error u Face ? What is the Message of error ? Explain In Detail.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
This is the complete error.
Error in File C:\DOCUME~1\ALIRAZ~1\ASPNET\LOCALS~1\Temp\temp_2d2350fe-39ee-4e43-a51c-2503df13defd.rpt: Query Engine Error
|
|
|
|
|
I have searched lots of article about my problem on Internet,Found many article for single table but there is no solution for multiple tables .Plz help me
Regards
Ali
|
|
|
|
|
hi syed,
some time Crystal report Problem with Multiple table.
in place of select fields on Crysatal report from Multiple Table, you Select fields from Query which contain columns of multiple table.
create the query in database(Query 1) which contain record from Multiple Table.
Now in VS2005 IDE Perform Following.
Create Dataset from Data menu & after selecting appropriate databse,select Query1 from DataBase object VIews & name this dataset(dsQuery) & on crystal report choose this Dataset as datasource & place field from this dataset to Report
Hope This Helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi guys,girls,others
need to automate a report in word using vb6 and the results of a query on an access database. got as far as getting the info from the database now need to put it all in word. problem is the info might contain just one record or it might contain over 200 records, or even more, or nothing. so, never having accessed word from vb6 before and the last time i tried to write code was 8 years ago, i am having some problems here as you can well imagine.
help would be greatly appreciated.
|
|
|
|
|
Hi Carter,
Better an imperfect answer than no answer at all:
First thing I would consider if I were you is to forget about vb6, and go for vb.net. Its a bit scary and a little frustrating at first but give it two weeks and you'll wonder why you ever considered doing it in vb6. With vb.net it is very easy to retrieve data from any source, stick it into an xml file, which in turn is relatively easy to turn into a word file, or any other MS Office format for that matter. This will also make your code work with pretty much all versions of Word.
If that is not an option for you, you should consider starting off with Word and not vb6. In other words, open a word file and play around with Word's own macro functionality, which Visual Basic Editor in itself is roughly the same as vb6 anyway. You could probably just copy most of the code you wrote so far, and you won't have to struggle with getting Word to work and accept input, etc, etc.
If that too is of no help to you, I suggest posting a new question on this forum and being way more specific about the problem you are facing. (bits of example code, error messages, specific steps you don't know how to take, etc.)
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Dim strCountry As String
Dim strCustomer As String
Dim strManufacturer As String
Dim strBitMake As String
Dim strBitSize As String
Dim strMotorType As String
Dim strBlockNumber As String
Dim strSectionNumber As String
Dim strDepthIn As String
Dim strDepthOut As String
Dim strFootageDrilled As String
Dim strFormation As String
Dim strFormation1 As String
Dim strSearch As String
Dim strRst As String
Dim strPunctuation As String
Dim lngLen As Integer
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oTable As Word.Table
Dim oPara1 As Word.Paragraph
Dim oRng As Word.Range
Dim oShape As Word.InlineShape
Dim oChart As Object
Dim Pos As Double
If cboCountry.Text <> "" Then
strCountry = cboCountry.Text
strRst = "SELECT Countryid FROM Country WHERE Country LIKE " & "'" & strCountry & "'"
Rst.Open strRst, Cnn, adOpenDynamic, adLockOptimistic
strCountry = "BitRun.CountryID = " & Rst.Fields("Countryid").Value & " AND "
Rst.Close
strRst = ""
Else
strCountry = ""
End If
If cboCustomer.Text <> "" Then
strCustomer = cboCustomer.Text
strRst = "SELECT Customerid FROM Customer WHERE Customer LIKE " & "'" & strCustomer & "'"
Rst.Open strRst, Cnn, adOpenDynamic, adLockOptimistic
strCustomer = "BitRun.customerid = " & Rst.Fields("Customerid").Value & " AND "
Rst.Close
strRst = ""
Else
strCustomer = ""
End If
If cboManufacturer.Text <> "" Then
strManufacturer = cboManufacturer.Text
strRst = "SELECT BitManufacturerid FROM Bit_Manufacturer WHERE Manufacturer LIKE " & "'" & strManufacturer & "'"
Rst.Open strRst, Cnn, adOpenDynamic, adLockOptimistic
strManufacturer = "BitRun.BitManufacturerid = " & Rst.Fields("BitManufacturerid").Value & " AND "
Rst.Close
strRst = ""
Else
strManufacturer = ""
End If
If cboBitSize.Text <> "" Then
strBitSize = "BitRun.Size = '" & cboBitSize.Text & "' AND "
Else
strBitSize = ""
End If
If cboMotorType.Text <> "" Then
strMotorType = cboMotorType.Text
strRst = "SELECT MotorID FROM Motor WHERE MotorType LIKE " & "'" & strMotorType & "'"
Rst.Open strRst, Cnn, adOpenDynamic, adLockOptimistic
strMotorType = "BitRun.MotorID= " & Rst.Fields("MotorID").Value & " AND "
Rst.Close
strRst = ""
Else
strMotorType = ""
End If
If cboBlockNumber.Text <> "" Then
strBlockNumber = "BitRun.BlockNumber = '" & cboBlockNumber.Text & "' AND "
Else
strBlockNumber = ""
End If
If cboSectionNumber.Text <> "" Then
strSectionNumber = "BitRun.SectionNumber = '" & cboSectionNumber.Text & "' AND "
Else
strSectionNumber = ""
End If
If txtDepthIn.Text <> "" Then
strDepthIn = "BitRun.MDIn" & txtDepthIn.Text & " AND "
Else
strDepthIn = ""
End If
If txtDepthOut.Text <> "" Then
strDepthOut = "BitRun.MDOut" & txtDepthOut.Text & " AND "
Else
strDepthOut = ""
End If
If txtFootageDrilled.Text <> "" Then
strFootageDrilled = "BitRun.FootageDrilled" & txtFootageDrilled.Text & " AND "
Else
strFootageDrilled = ""
End If
If txtFormations.Text <> "" Then
strPunctuation = ","
strFormation1 = Replace(txtFormations.Text, strPunctuation, " OR BitRun.Formation = ")
strFormation = "BitRun.Formation = " & strFormation1
Else
strFormation = ""
End If
strSearch = "SELECT * FROM BitRun WHERE BitRun.Performance NOT LIKE 'Poor' AND " & _
strCountry & strCustomer & strManufacturer & _
strBitMake & strBitSize & strMotorType & strBlockNumber & strSectionNumber & _
strDepthIn & strDepthOut & strFootageDrilled & strFormation
If Right(strSearch, 5) = " AND " Then
lngLen = Len(strSearch) - 5
strSearch = Left$(strSearch, lngLen)
strSearch = strSearch & ";"
Else
strSearch = strSearch & ";"
End If
Set rstSearch = New ADODB.Recordset
rstSearch.Open "SELECT * FROM SQLSearchTextString", Cnn, adOpenDynamic, adLockOptimistic
If Not rstSearch.EOF Then
rstSearch.Delete adAffectCurrent
End If
rstSearch.AddNew
rstSearch.Fields("sqlsearch") = strSearch
rstSearch.Update
rstSearch.Close
'Start Word and open the document template.
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Add
oDoc.PageSetup.Orientation = wdOrientLandscape
oDoc.PageSetup.LeftMargin = 10
oDoc.PageSetup.RightMargin = 10
oDoc.PageSetup.TopMargin = 30
'Insert a paragraph at the beginning of the document.
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Diamant Drilling Services Run Report"
oPara1.Range.Font.Name = "Arial Rounded MT Bold"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 28
oPara1.Range.Font.Bold = False
oPara1.Range.InsertParagraphAfter
oPara1.Range.InsertParagraphAfter
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "QDC"
oPara1.Range.Font.Name = "Arial"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 8
oPara1.Range.Font.Bold = True
OK, there you have it, my probably totally unprofessional attempt at coding, but it works so far so i must say i am quite pleased with myself.
my problem is with the range object i think. i need to have more than one word on a line and i just cant seem to do this. the first line is to have the headers and the following lines are to have the information organised under the relevent headers.
vb.net is not an option, i only have vb6 and not even the msdn help files so battling is putting it mildly.
|
|
|
|
|
Johan wrote: you won't have to struggle with getting Word to work and accept input, etc, etc.
Carter Langley wrote: battling is putting it mildly
Which costs more vb.net or your mental health?
But seriously, besides the comments I posted earlier, I am afraid I can't help you further. My suggestion is to post only the bottom part of the code you posted in a new question:
Carter Langley wrote: Set rstSearch = New ADODB.Recordset
rstSearch.Open "SELECT * FROM SQLSearchTextString", Cnn, adOpenDynamic, adLockOptimistic
If Not rstSearch.EOF Then
rstSearch.Delete adAffectCurrent
End If
rstSearch.AddNew
rstSearch.Fields("sqlsearch") = strSearch
rstSearch.Update
rstSearch.Close
'Start Word and open the document template.
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Add
oDoc.PageSetup.Orientation = wdOrientLandscape
oDoc.PageSetup.LeftMargin = 10
oDoc.PageSetup.RightMargin = 10
oDoc.PageSetup.TopMargin = 30
'Insert a paragraph at the beginning of the document.
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Diamant Drilling Services Run Report"
oPara1.Range.Font.Name = "Arial Rounded MT Bold"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 28
oPara1.Range.Font.Bold = False
oPara1.Range.InsertParagraphAfter
oPara1.Range.InsertParagraphAfter
Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "QDC"
oPara1.Range.Font.Name = "Arial"
oPara1.Range.Font.Color = wdColorBlue
oPara1.Range.Font.Size = 8
oPara1.Range.Font.Bold = True
It works so far so i must say i am quite pleased with myself.
my problem is with the range object i think. i need to have more than one word on a line and i just cant seem to do this. the first line is to have the headers and the following lines are to have the information organised under the relevent headers.
I am sure that someone can help you with this, because it is not at all an uncommon automation project.
Carter Langley wrote: my probably totally unprofessional attempt at coding
And don't sell yourself short. The question of professional or unprofessional coding is only interesting for the hardcore C++ nerds (they seem to have a real hangup about it ).
Good luck with it,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi,
i had used internetwritefile in vb6 it worked fine.but when i m using in vb.net it is returning 0.any sample will help me alot.
tx
|
|
|
|
|
Why are you even using it when there is a Ftp client already built into the .NET Framework 2.0, using the FtpWebRequest[^] and FtpWebResponse[^] classes.
|
|
|
|
|
i am deveoping a project with vb as frontend and sql as back end and any data entered through the vb form should automaticaaly get updated in sql table. I have tried with adodb connection but failed to succeed in it. Plz can u send me the code to connect from front end vb to backend sql with updations done regularly when code is added
Thanking you,
shaheen
|
|
|
|
|
Dim Cnn As ADODB.Connection
Dim Rst As ADODB.Recordset
set cnn = new adodb.connection
Cnn.Open "Your database connection statement goes here"
set rst = new adodb.recordset
rst.open "Your SQL Query Statement",Cnn,adOpenDynamic, adLockOptimistic
you can now manipulate your database information, like add, delete, etc.
hope this helps. this works for VB6 when you have referenced ado.
|
|
|
|
|
i am deveoping a project with vb as frontend and sql as back end and any data entered through the vb form should automaticaaly get updated in sql table. I have tried with adodb connection but failed to succeed in it. Plz can u send me the code to connect from front end vb to backend sql with updations done regularly when code is added
Thanking you,
shaheen
|
|
|
|
|
There is an SQL Client provider that you can use. I'm not sure if you have to install it or it is part of the core package. Try looking for DataAdapters/Command/other database objects here:
System.Data.SqlClient
If you need connection string information try this site:
http://www.connectionstrings.com/[^]
Hope this helps.
|
|
|
|
|
hi,
i am developing a client-server application in vb.net.
I am using a socket class in it.
I declared one object in my client application as:
dim clientSck as TcpClient
clientSck.connect(ipaddress,portno)
here if server application is not running it raised the exception,
so how this can be handled, how can i include state property to check state connected or not.
Please tell the solution.
|
|
|
|
|
d_smita wrote: dim clientSck as TcpClient
clientSck.connect(ipaddress,portno)
here if server application is not running it raised the exception,
Wrap this in a Try/Catch block to get the exception and handle the problem however you want.
Try
clientSck.Connect(ipaddress.portno)
Catch ex As SocketException
' The Connect call threw an exception
' Do whatever you need to do to handle the situation
End Try
The TcpClient class already exposes a Connected property. It's true if a connection was successful, otherwise false.
|
|
|
|
|
can i protect my files by applying the password using the vb.net.i mean can i apply some restrictions.I want to start fom the scratch.what should I do?
-- modified at 6:37 Friday 25th May, 2007
|
|
|
|
|