G_Waddell 131 Posting Whiz in Training

Glad I could help.

G_Waddell 131 Posting Whiz in Training

Hi,

I would definately use a database, the only other alternative I can think of is writing out the data to a text file which you should avoid as you have no way of preventing someone outside the program modifying or deleting it.

G_Waddell 131 Posting Whiz in Training

Hi,

Just taking a guess here but what does colProcesses.Count actually return?
How about:

If colProcesses.Count > 0 Then
   ToolStripStatusLabel1.Text = "FSX Status: Connected"
Else
      ToolStripStatusLabel1.Text = "FSX Status: Not Connected"
End if

OR

If colProcesses.Count IsNot Nothing then
 ToolStripStatusLabel1.Text = "FSX Status: Connected"
Else
      ToolStripStatusLabel1.Text = "FSX Status: Not Connected"
End if
G_Waddell 131 Posting Whiz in Training

Hi,

I would never use an access database:
PROS
1. Nice interface
CONS
1. Microsoft do not recommend the use of Access for more than 5 users at a time.
2. SQL Server Express is Free
3. SQL server Express is more robust
4. SQL Server Express supports many of the more advanced features available in the full SQL Server version, such as stored procedures, views, functions
5. You can design security into the DB level by only giving the user access to views and stored procedures i.e. no direct access to Tables.
6. SQL Server Express has the same backup and restore functionality as the more expensive Editions


The only down side to SQL Express I can see is the lack of an interface, but you can get Managment Studio from a more expensive Edition to interface with it.

G_Waddell 131 Posting Whiz in Training

Hi,

Resolved the issue!
I added a connection string and the sql statement to the opendatabase object.
This populated the fields but they all came in mixed up

.OpenDataSource(Name:=srcFile, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
                                WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
                                Connection:="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""" & srcDirectory & """;Mode=Read;Extended Properties=""HDR=YES;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=96;Jet OLEDB:Database Locking Mode=" _
                                , SQLStatement:="SELECT * FROM Addresslist.csv", SQLStatement1:="", SubType:=wdMergeSubTypeOLEDBText)

I then took a look at the mailmerge fields and the autotext and I found an example with slightly different syntax so I tried a few different variations and eventually got the text to go where I wanted it.

With .Fields
                    Dim MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address1""")
                    oWord.Selection.TypeParagraph()'inserts and selects a new paragraph
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address2""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address3""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address4""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address5""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address6""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Address7""")
                    oWord.Selection.TypeParagraph()
                    MySelection = oWord.Selection.Range
                    .Add(Range:=MySelection, Name:="""Country""")
                End With
G_Waddell 131 Posting Whiz in Training

Hi
You've defined your SQL insert statement but I don't see you doing anything with it.
For insertting records to a database I just do something like this as I find it easier: (actually I'd use a SQL Database with a stored procedure as it is more secure and SQL express is free)

sub SaveMyRecord ()
dim sql as string

sql = "INSERT INTO [Table1] (Tag_ID, fName, sName, Address, Contact, car_Make, car_Model, car_Reg) VALUES ( '" &Tag_IDTextBox.Text &"', '" &FNameTextBox.Text &"', '" &SNameTextBox.Text &"', '" &AddressTextBox.Text &"', '" &ContactTextBox.Text &"', '" &Car_MakeTextBox.Text &"', '" &Car_ModelTextBox.Text &"', '" &Car_RegTextBox.Text &"')"

dbProvider = "Provider = Microsoft.ACE.OLEDB.12.0;"        
dbSource = "Data Source = C:\myProjects\jmCarPark1\jmCarPark1\JMdataBase.accdb;Persist Security Info = True;"         
con.ConnectionString = dbProvider & dbSource         
con.Open()
dim cmd as OleDBCommand
with cmd
  .Connection = con
  .text = sql
end sub
cmd.ExecuteNonQuery()
G_Waddell 131 Posting Whiz in Training

It could well be a single dll file that once you find it you can include it in the deployment package.

One of the reasons for the .net framework was to move all this on to the OS so you would just call standard objects in your code e.g. system.data and the OS would supply whatever version it had.

But the same still applies if you put a specific reference to a com object into your code, you have to include the dll when you deploy or hope it is already there.

G_Waddell 131 Posting Whiz in Training

Sorry I was not clear.

Your project will reference certain dll files which it will look for in order to run. They should be found under references under the project menu? Anyway if you deploy to a host that does not have the required versions of these files you will be unable to run the project. e.g. keeping it simple, if include a reference to Word 2000 in your project and Word 2000 is not installed on the machine your project wont work. A required dll is probably missing or of a different version in Vista when you install the VBE on the machine the correct (or missing dll) is installed which makes me think it is one of the VB6 run time files, anyway the VB6 forum guys should be able to helpas I said it's been a while since I did the old school VB.

G_Waddell 131 Posting Whiz in Training

Hi,

You've posted this in the VB.net forum instead of the VB6 one.

Err... I'm a bit rusty with VB6 are you using the package and deployment wizard? It does look like your app needs a file that comes with VBE but what one?

What references do you have in your project and are the associated Dll's installed on your Vista box?

G_Waddell 131 Posting Whiz in Training

Hi
I'm 100% sure on this but as .visible is a boolean you maybe able to do something like this:

for each Row in MyDatagridview.Rows
  if Row.Visible = false then Row.visible = true
next

The question is does the .visible let you "read" from it or only set the value...

G_Waddell 131 Posting Whiz in Training

Hi
I had written an in VB.net that took addresses from a database put them into a csv file then took the csv file data and performed a mail merge in Word to allow the user to print them out on to an Avery L7163 label sheet.

The app was working fine until our company upgraded from Windows XP with office 2000 to Windows 7 with Office 2010.

Instead of getting the labels populated with the address data there are what appear to be form fields printed e.g. <<Address 1>>. Also they are not appearing in the order they should be but rather as a random mis-mash here is the code:

Sub PrintAvery(byref Printer as string, byref Tray as integer, byref CSVFile as String)
	Dim oWord As Object = CreateObject("Word.Application")
	Dim oDoc As Object  = oWord.Documents.add
	With oWord
		.visible = False
		.DisplayAlerts = wdAlertsNone
		.MailingLabel.DefaultPrintBarCode = False
	End With
	'suspect this part is not working as fields not coming in correct order
	With oDoc.MailMerge.Fields
		Dim MySelection = oWord.Selection.Range
                .Add(MySelection, "Address1")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address2")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address3")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address4")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address5")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address6")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Address7")
                oWord.Selection.TypeParagraph()
                .Add(MySelection, "Country")
                oWord.Selection.TypeParagraph()
        End With
        Dim myContent = oDoc.Content
        oWord.NormalTemplate.AutoTextEntries.Add("MyLabelLayout", myContent)
        myContent.Delete() 'we no longer need this as we have added it as autotext or have we?	
	Dim ActiveDoc = oWord.ActiveDocument
 	With ActiveDoc.MailMerge
        	.MainDocumentType = 1
                .OpenDataSource(Name:=CSVFile, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
                                WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, Format:=0, Connection:="", SQLStatement:="", SQLStatement1:="")
        End With
	Dim oDoc2 As …
G_Waddell 131 Posting Whiz in Training

Hi All,

I figured it out I should have been using Integers instead of Longs.

G_Waddell 131 Posting Whiz in Training

Hi All,

I have an application written in VB.net for batch print jobs. As part of the application, the user selects two printer trays to use to print the batch to (one plain paper the other coloured for coversheets and batch seperators) I had this working until we upgraded our systems from Windows XP with Office 2000 to Windows 7 and Office 2010. Now the selected trays are not being recognised and an error is thrown.

I've looked at similar posts on here and other forums but they seam to concentrate on using some word default trays (wdPrinterDefaultBin etc) however I need to be able to let the user pick whatever tray they wish to use. I don't want to have to go through every printer in the building and map the trays to the word values either as I don't want to rewrite the app everytime we've a new printer.

Here is the code:

sub PopulatePrinterTray (byref Printer as String)
'gets printer trays for selected printer and then populates some comboboxes
Dim pkSource As Printing.PaperSource
Dim printDoc As New Printing.PrintDocument

'Clear the comboboxes
 cbDocTray.Items.Clear()
 cbRedTray.Items.Clear()
'take printer paper sources i.e. trays
 printDoc.PrinterSettings.PrinterName = Printer
For Each pkSource In printDoc.PrinterSettings.PaperSources
  'dataitem custom class holds a ID and a string (displays string)
   cbDocTray.Items.Add(New DataItem(pkSource.RawKind, pkSource.SourceName))
   cbRedTray.Items.Add(New DataItem(pkSource.RawKind, pkSource.SourceName))
next
end sub

Sub PrintCover(byref MyCoversheet as String, byref Printer as String, byref RedTray as Long)
Dim oWord As Object = CreateObject("Word.Application")
Dim oDoc As Object = …
G_Waddell 131 Posting Whiz in Training

hi,
Use Listview.items.count to loop through the items in the list view:

dim MyTotal as Double
dim i as integer

for i=0 to Listview1.items.count-1
      Mytotal +=  Listview1.items(i).Value
next
G_Waddell 131 Posting Whiz in Training
G_Waddell 131 Posting Whiz in Training

Hi can you post your code?

On your page load are you using the page postback on the onload event?

If not then the page will execute the load instructions as the order the page renders in during a post back is 1. Reload page 2. process postback routine.

e.g for VB.net:

Protected Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 'Page always loads after postback so filter out code here 
 if not ISPostBack then
    'code to load in page that you only want in  page loading
 end if

end sub

Sub MyRegistrationThingy (ByVal sender As Object, ByVal e As System.EventArgs) Handles Whatever.Click()
  ' code you want to run
   response.redirect("~/Account/Thankyou.aspx")
End Sub
G_Waddell 131 Posting Whiz in Training

http://www.connectionstrings.com
Shows you how to connect to all types of database via ADO, ADO.net etc.

For Access, ensure that:
1. what ever user the Website runs under can access the file on the remote computer over the network.

2. The File is not going to be locked by another user opeing the Access File.


BTW SQL express is free and is better for connecting to via websites etc as it handles concurrent connections better. It's also more secure.

G_Waddell 131 Posting Whiz in Training

Are the same fields in each table?
Or are they different?
For tables being the same:

sub CopyData(byref Tbl1 as datatable, byref Tbl2 as datatable)
dim i as integer
Dim DataItems() as object

'clear Tbl2
Tbl2.rows.clear

for i = 0 to Tbl1.rows.count-1
 'populate Array with row items
  DataItems = Tbl1.rows(i).ItemArray
  Tbl2.rows.add(DataItems)
next
Datagrid1.datasource = Tbl2
Datagrid1.databind
end sub

For the different values then put just the appropriate data into the item array.

G_Waddell 131 Posting Whiz in Training

The Intellisense should be putting a wavy line under where your syntax is wrong or may lead to issues

G_Waddell 131 Posting Whiz in Training

Hi,
Do you want to create a blank record for the user to Edit each time a non matching item is in Table 2?
Where are you actually populating the datagrid from? Table 1? A query run on both?
Maybe you could post what code you have just now?

G_Waddell 131 Posting Whiz in Training

Try:

SELECT int_Exa, COUNT(*) as nbrTest FROM TEST GROUP BY int_Exa

The result set should will list each exam in the TEST table with a count of the number of each.

If you want a count of ALL exam (not just the ones that have tests,) then try:

SELECT EXAMIN.Int_Exa, ISNULL(T.nbrTest, 0) AS nbrTest FROM EXAMIN LEFT JOIN (
SELECT int_Exa, COUNT(*) as nbrTest FROM TEST GROUP BY int_Exa) AS T ON EXAMIN.Int_Exa = T.Int_Exa ORDER BY EXAMIN.Int_Exa

This will take each Int_Exa in the Examin table and left Join it to the Resultset from the previous example. If there is no match (i.e. no record in the TEST table,) it would return Null but the ISNULL function allows us to substitute the value 0.

G_Waddell 131 Posting Whiz in Training

Hi
You've misunderstood me.

Try unchecking the Sign Assembley with a strong name option then Deploying.

There isn't any option about Click Once Deployment and certificates? because I thought this would be the one causing the issue. Either with no certificate selected or an out of date one.

As I said before I'm just guessing on this but maybe someone else who has encountered this error will have a better Idea.

What Version of Visual Studio are you using?

G_Waddell 131 Posting Whiz in Training

Hi,

I've never encountered this issue but it would seam to me to be to do with your projects signing settings. Right click on your project in the sooution explorer and you will get an option to open the project properties screen (alternatively Project Menu, Properties).

Depending on which version of visual studio your are using you may see something slightly different from me (I'm using 2008) There will be a Signing tab in the properties screen. Under the tab, I'm getting options to sign the assembly with a strong name and the click once deployments with a certificate. I'd suspect that this is checked and the certifcate you are using has expired you should be able to renew the certificate there or turn the option off.

As I said I haven't encountered this before but that's the best gues I can come up with.

G_Waddell 131 Posting Whiz in Training

Hi Guys,

The problem was to do with the fact that if you are creating a document from scratch, there are no section properties and therefore there is no reference to the header unless you explicitly add them.

G_Waddell 131 Posting Whiz in Training

Hi All,

I'm using VB.net to create a batch of word documents using the Microsoft Office OpenXML SDK.

The documents are made up of a header and the main body which is made up of a table. I can sucessfully create the table in the main body. The issue is that the header does not appear in the document when I open it in word.

I've ran the document through the Open XML SDK 2.0 Productivity tool and it gives no validation errors and I can see the header.XML file and the refereneces to it in the the rel files and Content_Types. All the xml appears properly formed. I took a copy of one of the documents and changed the extension to .zip and looked at the xml in there as well.


Here is the header.xml file:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
<w:hdr xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
  <w:p w:rsidR="00D029D2" w:rsidRDefault="00D029D2">
  <w:pPr>
  <w:pStyle w:val="Header" /> 
  </w:pPr>
  </w:p>
  <w:p>
  <w:bookmarkStart w:name="Field_Logo" w:id="1" /> 
  <w:r>
  <w:t>Logo</w:t> 
  </w:r>
  <w:bookmarkEnd w:id="1" /> 
  </w:p>
  <w:p>
  <w:pPr>
  <w:pStyle w:val="Heading2" /> 
  </w:pPr>
  <w:bookmarkStart w:name="Field_Title" w:id="2" /> 
  <w:r>
  <w:t>Title</w:t> 
  </w:r>
  <w:bookmarkEnd w:id="2" /> 
  </w:p>
  <w:p>
  <w:bookmarkStart w:name="Field_Explanatory Statement" w:id="3" /> 
  <w:r>
  <w:t>Explanatory Statement</w:t> 
  </w:r>
  <w:bookmarkEnd w:id="3" /> 
  </w:p>
  </w:hdr>

Does anyone have any idea why it is not rendering in the document?

In my VB.Net code I'm creating a new word doc …

G_Waddell 131 Posting Whiz in Training

Hi,

You want to store a colour value in your DB?

It really depends on what you are using the colour for, you can store it as a string in Hex format e.g. 000000 (black), FFFFFF (white) or in RGB 0,0,0 (black), 255,255,255 (white) etc or even just "Black" or "White"

Where are you getting the colour from and what are you planning to use it for?

G_Waddell 131 Posting Whiz in Training

Hi

You should post some of your code, you're refering to an object that the code does not know exists or understands. Posting code samples inside the "CODE" "/CODE" tags will help others see what you are doing and maybe identify where it is going wrong. Have you tried going through the code in a step by step debug?

G_Waddell 131 Posting Whiz in Training

Hi
Does the user you are connecting to the database to have update permission on the Employee_DB table?

G_Waddell 131 Posting Whiz in Training

Hi Guys,

Look up any of the following in Google or similar:

ADO.NET DataReader
ADO.NET DataAdapter
ADO.NET Command

Pay attention to the examples given...

Also use the Access QBE to design your SELECT Query and switch to SQL view to get the Query in Access compatible SQL.

With out more specifics i.e. code that's the best help I can give you.

G_Waddell 131 Posting Whiz in Training

Hi
The SQL is basically the same...

Provide more details on where exactly you are stuck and we'll see what we can do..

G_Waddell 131 Posting Whiz in Training

Hi

Try looking here:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.aspx I'll give you a hint PostbackURL is a property of the linkbutton class

G_Waddell 131 Posting Whiz in Training

Hi

You should do something like this:

sub EmployeeSearch 

dim  EmployNo as integer
dim mySQL as string

EmployNo = cint(MyTextbox.text)
mySQL =  "SELECT * FROM tblEmployee WHERE (EmployeeNo =" &EmployNo &")"
'run query on db and get result.
G_Waddell 131 Posting Whiz in Training

Hi,

You are not checking your password value (from your query) to see if it is null it is possible that the exception is being thrown as you try to compare a string to a null value.

If strPassword = dr.Item("password") Then

(line 30)

Personally I'd change my query to something like this:

Dim strsql As String = "SELECT COUNT([userid]) FROM tbluser WHERE [userid]='" & g_login & "' AND [password] ='" &strPassword &"'"

If the entered details where correct, you should get 1 if not, a 0 that way you don't have to worry about nulls.

Again just personal preference

G_Waddell 131 Posting Whiz in Training

Hi
You would probably be better off using the FolderBrowserDialog class (see http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx) You can use this to get the folder path then loop through the files and sub directories in the root folder.

G_Waddell 131 Posting Whiz in Training

Okay Sir i get u so can you plz show me the whole program what at the end will display,i mean starting from the inputs,proccessing and outputs,and plz do this kind of loops For...Next,while and do untill bcoz im familiar to them.I hope you still remember my program statement.Still vesh2009

Hi,

So you want me to do your assignment / project for you???

You can pay me at Euro 25 /hour or try it yourself. If you get stuck come back and post a new post with your code on the part you are stuck on.

The only place success comes before work is in a dictionary

G_Waddell 131 Posting Whiz in Training

Hi,

I think I may have answered this in your previous question? http://www.daniweb.com/forums/thread296131.html

Anyway read in each line use the split function this will generate an array of a single row take this row and add it to your array.

Note of Caution: if your source file handles empty or null values by skipping them (i.e. instead of putting "1,2,,4" it puts "1,2,4") all bets are off as you will never know what column was skipped.

dim line, rowArr as string
dim Stream as new StreamReader ("MyFile")
dim i, x as integer 
dim 

line = Stream.readline 
While line <> "" 'while we have data
	rowArr = line.split(",") 'get array of row values
	if i=0 then 'first time in define the "big" Array
		x=rowArr.length-1 
		dim MyArray(x,0) as String 
		
	end if
	redim preserve MyArray(x,ubound(myArray,2)+1) 'increase upper boundary of second dimension of array by one while preserving entries
	rowArr.CopyTo(MyArray,i) 'copy the row into the "Big" Array at row i
	line = Stream.readline 'read next line
	i=i+1 increease your row counter
End While
G_Waddell 131 Posting Whiz in Training

hi there!calling for help
I have this program/project that is more on loops that says,write a program that will display a Fibonacci series when you click on a button.The first number entered should be indicator how many numbers of the series should be displayed a generated.So im confused whether using For...Next or While loop.
help!

Hi
You really should post this under your own thread.
As for your question you can use For... next, While...End While, Do While...Loop and Do Until...Loop they are all valid for looping. Basically use whatever you are more comfortable with.:)

dim i  as integer

for i=0 to Mylimit 
'do something
next

While i < limit
'do something
  i=i+1
End While

Do While i< limit
 'do something
 i=i+1
Loop

Do Until i = Limit
 'do something
 i=i+1
Loop
G_Waddell 131 Posting Whiz in Training

Hi,
You do not define the function or method with in your sub routine, it is available to all subroutines and functions with your form. Take line 10 out and it should work.

Dim CalculateCharges As Decimal 'not needed as CalculateCharges is a function

You have specified that the function takes in a double and returns a decimal when you defined it:

CalculateCharges(ByVal hours As Double) As Decimal

I can't see where your code (or posting,) mentions reading from a text file though.

G_Waddell 131 Posting Whiz in Training

Hi,

Ever had an application that you want to store user specific settings on? e.g. login name or Form background colours, User specifc DSN connections etc. So the next time they run the app the information is there for them?

This can be achieved in VB.net with just a few easy steps.

  1. Set up your user level application setting.
  2. Write values to it
  3. Read those values back

1. Setting Up User Scoped Application
In the Solution Explorer Window, select your project and right click. Select the Properties option in the sub menu.
In the Properties Screen there should be a Settings tab, open it.
You should now see a grid with the following columns:
Name The Name you wish to give the settting
Type The Type of settng value e.g. String, Integer etc.
Scope User or Application, Pick USER as this is user specific and can be modified programatically while the application is running.
Value A default value for the setting

Application Scope is a system wide fixed value that writes to app.config which can be changed programmatically but this change can not be accessed until the project is reloaded. User Scope writes to a file in C:\Documents and Settings and can be accessed at any time by the program for the specific user.

2. Write Values to your Setting
As can be seen in the Example Sub StoreSettings once you have carried out step …

Oxiegen commented: This is excellent +5
savedlema commented: Thanks for this. I'd like to know how I can modify the application scope settings. I will start a discussion on vb.net here. +2
G_Waddell 131 Posting Whiz in Training

Something else that occured to me

I m using access2007 database.
since Last week,

What were you using before? And did this only occur since you switched databases?

G_Waddell 131 Posting Whiz in Training

Hi,

Is it possible that someone or something is opening your access file locally and therefore locking the DB table? (do you back the DB up for instance?)

Or is this site in Production and more than one person is accessing the same table at a time?

I have a feeling that Access may only allow a single user access to a table at any given time.

I know that theorically the Jet DB engine can allow up to 255 users but it isn't really recommended for Web apps :http://msdn.microsoft.com/en-us/library/ms811092 and
http://support.microsoft.com/kb/222135/en-us

You may want to consider switching to Microsoft SQL Server which is more robust and the Express editions are free.

G_Waddell 131 Posting Whiz in Training

You'd run a query like this:

"SELECT * FROM MyTable WHERE pinno =" &textbox1.text &" and acctno = " &textbox2.text

If you get no data back then there is not a match...

G_Waddell 131 Posting Whiz in Training

Hi,

You cannot create a folder in the Client machine that would be a major security breach.

I answered point 2 for you about six days ago.

G_Waddell 131 Posting Whiz in Training

Hi,

I'd be very cautious about letting anyone upload an exe file to my site. There is a reason the FTP server is blocking them...

That being said there's times you need to allow it too. I usually have a list of blocked extensions that I check before upload and if it is one of them, I ask the user to zip the file first. You don't want to just turn the file to a .exe without checking it out first.

dim BannedList as String =".exe,.vbs,.js"
...

if instr(BannedList, Myextension) <> 0 then
''show message
else
 'allow it
end if
G_Waddell 131 Posting Whiz in Training

Hi,

It could be a number of things, someone else may be opening your Access file on the network (or locally) or it could be open connections from your site code.

In order to minimise the risk of it being your code, you should open the connection just before you use it and close down the connection immediately after e.g.

Sub UpdateCustomers(ByRef CustomerID As Integer, ByRef Status As Integer)
        Dim cmd As OleDb.OleDbCommand
        Dim conn As OleDb.OleDbConnection
        conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False"
        With cmd
            .CommandText = "UPDATE Customers Set Status=" & Status & " WHERE CustomerID=" & CustomerID
            .CommandType = CommandType.Text
            .Connection = conn
        End With
        If conn.State <> ConnectionState.Open Then 'open Conn just before execution
            conn.Open()
        End If
        cmd.ExecuteNonQuery()
        If conn.State <> ConnectionState.Closed Then 'close conn immediately after.
            conn.Close()
        End If
    End Sub
G_Waddell 131 Posting Whiz in Training

Hi,

If you've used split then you already have an array (or in this case, a row of your array)

G_Waddell 131 Posting Whiz in Training

Hi,

There are a couple of ways to do this one is to read each line in using filesystemObject or system.io.

Another is to open an excel object and read the csv file in you can then interact with it as if it were a database and even query it. My main concern would be the amount of data you have, I'm not sure if Excel will be able to handle it.

G_Waddell 131 Posting Whiz in Training

Hi,

Does the user you are connecting to the access DB with have write permissions on the file / directory? The code looks ok but if the table is empty something is stopping you.

G_Waddell 131 Posting Whiz in Training

Hmmm...
You'll need to somehow "capture" the file path you are selecting.

I think you'd find it eaiser to use something like the treeview control in your app to give you an "Explorer" type view that you could then select the file node from.

G_Waddell 131 Posting Whiz in Training

Hi

You need to get your folder selection into a string and then open a folderdialog with the path set to that string.

Where are you selecting / cutting / dragging your folder paths from?