|
hellow i am coding a program ...
i am trying to pick a value from the datagrid ...
i pick the value fine !
but when i run the sql statment i recive the next error
"no value given for one or more required parameters"
here is the code .
Dim sConnection, ssql As String
Dim cellnum As Object
Dim row As Integer = DataGrid1.CurrentCell.RowNumber
Dim coll As Integer = DataGrid1.CurrentCell.ColumnNumber
cellnum = (DataGrid1(row, coll))
MessageBox.Show(cellnum)
Try
sConnection = "provider=microsoft.jet.oledb.4.0;data source=C:\Printers.mdb"
ssql = "Select * From [add] Where (Num ="
ssql = ssql & "'" & cellnum & "')"
MessageBox.Show(ssql)
Dim OleDbConn As OleDbConnection = New OleDbConnection(sConnection)
OleDbConn.Open()
Dim MyDataReader As OleDbDataReader
Dim MyOleDbCommand As OleDbCommand = New OleDbCommand
Dim MyDataSet As DataSet = New DataSet
Dim MyOleDataAdapter As OleDbDataAdapter = New OleDbDataAdapter
MyOleDataAdapter.SelectCommand = New OleDbCommand(ssql, OleDbConn)
MyOleDataAdapter.Fill(MyDataSet)
MyOleDbCommand.Connection = (OleDbConn)
MyOleDbCommand.CommandText = ssql
MyDataReader = MyOleDbCommand.ExecuteReader
Do While MyDataReader.Read
txt_type.Text = (MyDataReader("Machine_Type"))
txt_model.Text = (MyDataReader("Machine_Model"))
txt_serial.Text = (MyDataReader("Machine_Serial"))
Loop
MyDataReader.Close()
OleDbConn.Close()
OleDbConn.Dispose()
Catch err As System.Exception
MessageBox.Show(err.Message)
End Try
thxx great board !
|
|
|
|
|
it's a error at SQL
I Love my lover like you do!
|
|
|
|
|
please check it:
-------------------------------------------------
ssql = "Select * From [add] Where (Num ="
ssql = ssql & "'" & cellnum & "')"
-------------------------------------------------
|
|
|
|
|
any one know what
"no value given for one or more required parameters" error stand for ?
|
|
|
|
|
It means there are one or more parameters which are required, but you didn't provide them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You might want to change the name of that table, "add" to something that is not a reserved word.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
we are students and we have our thesis this semester... we're looking for some guidelines on ways we could accomplish our objectives.
Details:
Title: Advanced Duplicate File Scanning Tool Over LAN
Model of the Study: NoClone
Problems:
1. Comparing files produce inaccurate results.
* Distinguishing same contents in different text file formats as duplicate file.
There are times that users make used of notepad (.txt) as a way to edit or make drafts of something to start a document, afterwards it will be transferred to MS WORD. The content made in notepad is the same as the document transferred to MS WORD, meaning both of them has exact contents, logically they were duplicates but this case was ignored by the system because they have different formats (Not Supported).
*Failure to recognize files with the following scenarios
test.doc has been created and copied, producing files such as “copy of test.doc”, “copy (1) of test.doc”, “copy (2) of test.doc”, “copy (3) of test.doc” , “copy (4) of test.doc”. On the latter part, after the scanning process with NoClone, there is no results listing these five files are said to be duplicate files.
In addition, the proponents made a word document and typed the word “test” and it was then saved with “test.doc” filename. Afterwards, the file was intentionally “Save As” to another filename with the same content. This procedure continues until it reaches the fourth similar file which is “test4.doc”. Right after the saving of file, NoClone application was launched and tested to scan duplicate files. But surprisingly it didn’t found anything. This kind of instances only shows that it doesn’t have enough capability to have complete and reliable scan.
Furthermore, NoClone is unable to scan within the archive of .zip or compressed file. In scanning for duplicate files, NoClone doesn’t include the files contained by the zip or compressed file nevertheless, it ONLY include the .zip file itself but not including the file being compressed.
2. No option to search for a particular file name or folder to search for its duplicate
The system doesn’t have a field or an option to key in a particular filename or folder which a user wants to find distinctively. The ability to search for a particular file name is such a useful function so that the scanning process will not produce unintended results.
3. Inability to schedule the scanning process at specific date and time, identifying which computer to scan and compare.
As the file grows bigger everyday, there’s a huge chance that one of those files are duplicated which could consume much of the disk space. If the administrator wants to schedule a scan as part of maintenance routine to accumulate all the wasted spaces, the admin needs of course a way or an option to set the schedule. But unfortunately, this was not made available by the system.
This limitation made this application uneasy for administrators who want to set everything in place, so that if ever he/she forgot to check for duplicates between the targeted period the system would still remember and would make the work for them.
4. There is no option to separate original from duplicate files as a part of removal procedure.
After the scan process for duplicate files, it would display all detected items. But the problem is when you decide to delete all duplicate files whether manually (one-by-one, very tiresome) or clicking the option to mark all files (Recommended action); in this event the source file is also detected. There’s no option to delete only the duplicated items and leave one unique file (source file) without manually unmarking it from the list, making it hard and tiresome for the user. Like for example, the system detects 3,000 duplicate files within a single drive, the user need to selectively leave one file unchecked, in which it’s a lot of effort to do especially if the result contains a lot of items.
Objectives:
1. Make use of comparison algorithms to produce accurate results
a. Provide a content-based (using line-by-line comparison) scanning mechanism to support detection of duplicate file regardless of format, filename, and size
b. Use CRC/MD5 algorithm to efficiently scan the files within the chosen directory or path to produce much accurate results.
c. Provides a mechanism in which .zip files could be scanned within its archives and
2. . Provide filename and folder search option to search for an intended item.
3. Provide duplicate file scan scheduling in a specific date and time and specify which computer to scan and compare.
4. . Provide an option to separate original from duplicate files (removal procedure) to retain the source file without manually unmarking it.
*Objectives will be implemented in a LAN network (Network Application)
* we hope that somebody out here would help us... specifically on the ways how we could program... or does anyone here have codes which we could use for this study... thanks..
|
|
|
|
|
1. For your first problem you need to be able to read each of the file formats to get the text each file contains and compare.
2. Your second problem is simple. When you are scanning the computer for the duplicate files, log each duplicate file's name and path in an array. When your scan completes, list the results with checkboxes by them so the user can choose which files to delete and which files to save. You can also make it so the user can double-click on the item and view it before he makes his choice.
3. Windows has Scheduled Tasks folder that you can open and schedule a date and time to scan. If you look hard enough, you can probably find some code somewhere on the Internet that will allow you to add a scheduled task.
I'm assuming you are using Windows. In order to help out more I need to now what programming language you are using. Are you making this file scanner from scratch or do you already have some code to start out with? I'm not going to help you out much because this is a thesis. Don't get the wrong idea.
|
|
|
|
|
thanks alot. we're plannning to use VB 6.0... we want it from scratch. is it possible to imbed a code to an existing duplicate file finder?
|
|
|
|
|
kenvil wrote:
is it possible to imbed a code to an existing duplicate file finder?
Only if you have the source code for the file finder. But then it wouldn't really be from scratch.
VB6 comes with the DriveListBox, DirListBox, and FileListBox controls to get information about drives, folders, and files on the local computer. I don't think that you can set them to return information about a remote computer. You will probably have to create two apllications. A client program that runs in the background and allows the user to clean his own machine if he wishes to, and an administrator program that can connect to the client program on a remote computer. The client program will scan the computer as requested by the administrator program. The administrator can then decide what to do with the duplicate files. I don't know much about how to send this sort of information over LAN but, if you are willing to learn it, DirectPlay can probably be of use to you.
If you don't like the DriveListBox, DirListBox, and FileListBox controls that come with VB, you can check out the FindFirstFile, FindNextFile, and FindClose functions of the kernel32 DLL. I've used these calls before and can send you snippets if you are interested.
|
|
|
|
|
|
kenvil wrote:
The content made in notepad is the same as the document transferred to MS WORD, meaning both of them has exact contents, logically they were duplicates but this case was ignored by the system because they have different formats (Not Supported).
Maybe by your "logic", but there is absolutely no reason to assume that the user considers the file a duplicate.
Case in point: I have a resume, that I create with Word 2003. However I recognize that many potential employers may have an older version of Word. So I save the document in a Word 98 format on the assumption that any one can read that format. I have a third version which is saved as a simple text file because that is the format often encountered when submitting a resume through a website.
All three documents have the same "content", but they are by no means duplicates.
|
|
|
|
|
Im trying to import a CSV file into an access db using dao
The following code works well in the connection
Set tmpDB = DAO.OpenDatabase(ActiveWorkbook.Path, False, True, "Text;Database=C:/TEMP;Table=test.csv;HDR=Yes;FMT=Delimited;")
However part of the data is lost in the proccess.
I think that if I force all fields to behave as strings(varChar) I can solve this problem.
Does anyone know how to do this?
|
|
|
|
|
You might want to try adding the IMEX option to the connection string:
Text;Database=C:\TEMP;Table=test.csv;HDR=Yes;FMT=Delimiteed;IMEX=1;
You can see this[^] KB article on MSDN for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
In that case, I have no idea what it is.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
in vb.net when we create connection string
we want dsn name in the connection string i want connection via sqlserver
please suggest me what connection string i write
notify i don't want server name and database name in the connection string.
please help me
|
|
|
|
|
I just looked at this last week. Ummmm....I think you have to use the OLEDB classes and the connection string would be something like
"Provider=MSDASQL;DSN=dsnname"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My Design View and Code View don't coexist together anymore.
I can create a simple, new app -- text box and command button, for example. (all other projects closed)
Double-click on the button -- the code window opens and the Design tab is at the top -- as it should.
If I close both windows and click on the app in the solution explorer, the design view opens -- as it should.
????? If I right-click and select "View Code", the code window opens, but the design view goes away, no tab, nothing. If I then double-click the app in the solution explorer, design view comes back, but the code tab disappears ?????
I use VS .NET 2003 at two different locations. It worked fine on both computers until this VS went bonkers.
I have run setup again, choosing 'repair', but the problem persists.
|
|
|
|
|
In Tools->Options->Environment->Documents, "Re-use current document window, if saved" should be unchecked.
Charlie
if(!curlies){ return; }
|
|
|
|
|
thank you -- that was the problem
|
|
|
|
|
hi
I have an database tabel that i wana to bind it to a comboBox ...
I wana load all the data in the combobox from a spicefesic field
how can i do this ?
thx
|
|
|
|
|
There are three simple ways you can do this (in VB6 anyhow).
1. Use the Data Source property of the combo box and link it to your database.
2. Use an adodc control to create a recordset of your table data and input it into the combo box.
3. Use a data environment which is connected to the database and create a temporary record set.
Do you know how to do these or would you like an example of some code using one/ all or them?
°[Halo]°
Project Basilisk
|
|
|
|
|
YES
IF U CAN GIVE ME AN EXAMPLE PLEAZE
U CAN SEND TO MY E-MAIL
YOSEF_SA@HOTMAIL.COM
THANK YOU
|
|
|
|
|
Hi,
i have a problem with executing select query which was added to dataadpter.
i have 2 select command.
' first select command
dbAdapterUsers.SelectCommand = New OleDbCommand _
("SELECT UserName FROM Users where UserName=? AND PassWord=?", dbConnGym)
dbAdapterUsers.SelectCommand.Parameters.Add("UserName", OleDbType.VarChar, 15, "UserName")
dbAdapterUsers.SelectCommand.Parameters.Add("PassWord", OleDbType.VarChar, 15, "PassWord")
' second select command
dbAdapterUsers.SelectCommand = New OleDbCommand _
("SELECT * FROM Users ", dbConnGym)
'filling the datatable
dbAdapterUsers.Fill(dsGYMObj.Users)
2 question:
1) if i change the order between the queries , i get error " parameter ?_1 has no default value." -- why its ok if i the order is as above
2)i execute login function - and i have a feeling that it execute the first query and not the one with the parameters.
login Public Shared Function Login(ByVal username As String, ByVal pass As String) As Boolean
dsGYMObj.Users.Clear()
dbAdapterUsers.SelectCommand.Parameters.Add("@UserName", OleDbType.VarChar, 15, "UserName").Value = username
dbAdapterUsers.SelectCommand.Parameters.Add("@PassWord", OleDbType.VarChar, 15, "PassWord").Value = pass
dbAdapterUsers.Fill(dsGYMObj.Users)
If Not dsGYMObj.Users Is Nothing Then
If dsGYMObj.Users.Rows.Count > 0 Then
Return True
Else
Return False
End If
End If
End Function
thanks
nir.
|
|
|
|
|