Hi Dw. What is the correct way to write an sql query like this? `"select * from MyTable where username ='username' And password ='Password'"` in vb.net. My problem is that on my database I have some usernames repeated but they differ by their passwords. Each record has a different information. When I tried this it will just return the wrong data especially if the intended record is not in the first same username record, it will just retrieve the first same username records, but I want to force it to only retrieve all data on the record where username and …

Member Avatar
Member Avatar
+0 forum 7

Hello Friends I am facing a little problem that I want to sort my records according to date I mean to say I want to show the upcoming records based on dates on the top in ascending order I have a complete working code to fetch from the database but I don’t know that why its not showing up according to my requirements here is my screenshot and database query. I am using MS Access, VB6 and Listview for displaying all records If rs.State = 1 Then rs.Close sql = "SELECT * FROM tblHallBook WHERE book_complete='0' AND book_status='1' ORDER BY …

Member Avatar
Member Avatar
+0 forum 1

I am facing a problem that I have to show database results from 3 different tables on a single report these three tables have are used for different purposes and want to show their headings details separately. I am using VB6 and designing this report in **DataReport** a common feature for this. **Table1** is for Menu Details Having following fields: Bill_ID, Menu Type, Cost **Table2** is for Services Details: Having following fields: Bill_ID, Service Name, Cost **Table3** is for Extra Details: Having following fields: Bill_ID, Description, Cost Now structure I want to is like this using common Bill ID, and …

Member Avatar
Member Avatar
+0 forum 2

Hi.. I have a gridview in form 1 and i am inserting records from form 2. How to refresh gridview in form 1. And filter gridview in form 1 based on comboboxPlease help..

Member Avatar
Member Avatar
+0 forum 3

How can I insert splitted texts to my ms access database? I can't seem to find the logic in it. :( Please help me. Here are my codes: This is where i split the texts that are inputted in textBox1, textBox2, and textBox3 string items = textBox2.Text; string[] splittedText1 = items.Split(' '); string quantity = textBox1.Text; string[] splittedText2 = quantity.Split(' '); string price = textBox3.Text; string[] splittedText3 = price.Split(' '); and this is the code where I will insert those texts to my database: OleDbCommand CmdSql = new OleDbCommand("Insert into [sales] ([productname], productquantity, productprice) VALUES (splittedText1, splittedText2, splittedText3); is this …

Member Avatar
Member Avatar
+0 forum 1

I've got this error: **Additional information: Data type mismatch in criteria expression.** I don't know why.. I want to use split text in a textbox and insert the splitted texts to ms access. Here is my code: string[] splittedText1 = textBox2.Text.Split(' '); string[] splittedText2 = textBox1.Text.Split(' '); string[] splittedText3 = textBox3.Text.Split(' '); string vsql = "Insert into [sales] ([productname], productquantity, productprice) VALUES (?,?,?)"; OleDbCommand CmdSql = new OleDbCommand(vsql, vcon); CmdSql.Connection = vcon; CmdSql.Parameters.AddWithValue("@productname", OleDbType.VarWChar); CmdSql.Parameters.AddWithValue("@productquantity", OleDbType.UnsignedTinyInt); CmdSql.Parameters.AddWithValue("@productprice", OleDbType.UnsignedTinyInt); for (int i = 0; i < splittedText1.Length; i++) { CmdSql.Parameters["@productname"].Value = splittedText1[i]; CmdSql.Parameters["@productquantity"].Value = splittedText2[i]; CmdSql.Parameters["@productprice"].Value = splittedText3[i]; CmdSql.ExecuteNonQuery(); } please …

Member Avatar
Member Avatar
+0 forum 1

hello all, I want to make some simple database in access that would track student information, semesters etc... I have created basic tables like: students, professors, subjects.. now I am stuck with the most important part: semesters and subjects... here is the link [Click Here](http://prntscr.com/2jafl6)where you can see database relationship diagram example (had to do it again in English lang for your convenience) Probably I did it all wrong, but here is what I thought and imagined: The idea is to have a form/subform in the main form to select or enter academic year, semester and dates in the subform …

Member Avatar
Member Avatar
+0 forum 1

hi my name is vishal. i have been trying long to figure out to export data from vb6 using join queries in sql to ms word. here is my sample code i have tried: Option Explicit Dim dIsVisible As Boolean Dim inst As String Private Declare Function ShellExecute Lib "shell32.dll" Alias _ String, ByVal lpszFile As String, ByVal lpszParams As String, _ ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long **Private Declare Function GetDesktopWindow Lib "user32" () As Long Const SW_SHOWNORMAL = 1 Const SE_ERR_FNF = 2& Const SE_ERR_PNF = 3& Const SE_ERR_ACCESSDENIED = 5& Const SE_ERR_OOM = …

Member Avatar
Member Avatar
+0 forum 1

I have just a user form in access 2007 with a text box and a Save command. MY code: Private Sub Save_Click() If School.Value = "" Then MsgBox ("Text Box is empty") else Msgbox(" Not Empty") End If End Sub When the Save is clicked, and the text box is empty, the second statement is executed with message "Not Empty". Why not first statement is exected first??

Member Avatar
Member Avatar
+0 forum 2

Private Sub Save_Record() Dim cmd As New OleDbCommand Dim sSQL As String = String.Empty Dim arrImage() As Byte Dim myMs As New IO.MemoryStream Dim bSaveImage As Boolean = False Dim strImg As String = String.Empty Try If Not IsNothing(Me.pic1.Image) Then Me.pic1.Image.Save(myMs, Me.pic1.Image.RawFormat) arrImage = myMs.GetBuffer Else arrImage = Nothing End If 'get connection string declared in the Module1.vb and assing it to conn variable con = New OleDbConnection(Get_Constring) con.Open() cmd.Connection = con cmd.CommandType = CommandType.Text 'I just use the textbox tag property to idetify if the data is new or existing. If Me.txtFacultyName.Tag = 0 Then sSQL = "INSERT INTO …

Member Avatar
Member Avatar
+0 forum 4

Hey guys Im doing some testing on a few database conversions from MDB format to accdb. I packged up my files so when the exe was ran it would install MS runtime as well as the databases needed for the app. I was trying to get it so that I wouldnt have to install MS office access on the client machine. I just wanted to run runtime so the client machine can still access the database/ forms. After installing my package i ran the desktop app and it booted up to an error saying a missing DLL was the conflict …

Member Avatar
Member Avatar
+0 forum 2

hi i m making a c# app which reads data from ms accesss & display it in textbox i have tried the following method but that didn't worked suggest me smthing or correct my code pls myconn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\nature bliss\Desktop\Stock\section1.accdb;Persist Security Info=False"); try { OleDbCommand cmd = new OleDbCommand(); cmd.Connection = myconn; cmd.CommandText = "select * from section1"; myconn.Open(); //MessageBox.Show("Sucessfully Connected to " + myconn.DataSource.ToString()); var reader = cmd.ExecuteReader(); while (reader.Read()) { textBox1.Text = reader["Name"].ToString(); } myconn.Close(); } catch (Exception ex) { MessageBox.Show(""+ex); } finally { myconn.Close(); }

Member Avatar
Member Avatar
+0 forum 1

I'm trying to search on how to store the image in a local folder and save its path and filename in ms access using vb.net but a lot of topic makes it more confusing for me. I'm just a student and working on my baby thesis. I'm currently building an employee's record and salary statement system where all values in registration form will be save in my database(ms access) including picture of the employee but i don't know how to start. Can anyone help me with my problem? I'm using vs 2005 with ms access 2003. Thanx in advance :)

Member Avatar
Member Avatar
+0 forum 2

I have written a program which allows agents of a call centre the ability to access a database (ms access) containing names of solicitors to allocate to. the database is stored centrally and i need a way to update the local dataset on the agents machine when a change is made to the database. I understand how to add, remove, update fields to the database using a OleDbDataAdapter but I need something that does the reverse. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 3

i have a datagridview in my vb.net form displaying data from ms access file A , table A , is it possible for me to export the data in the data gridview to ms access file A table B?? i'm not using sql.

Member Avatar
Member Avatar
+0 forum 3

hello :) i'm using MS access as a database of my Windows form application. i'm having problem with create table query, with variable table name. i have tried, but it din't work, as i tried. plz provide an example that can make me understand. suppose, string city = "newyork"; and city should be the name of table in example. Thanks :)

Member Avatar
Member Avatar
+0 forum 3

Don't know if this is right place for my question, but Does anyone know if it is possible to have multiple forms visible at the same time while developing an application with Access in "Form View" mode? If so, how does one tell Access to do this? This applies to both Access 2007 and Access 2010. Thank you, Chuckc

Member Avatar
Member Avatar
+0 forum 2

Hi all, I'm working on conference room booking software with MS-Access as the back end. I need to retrieve the records which doesn't clash with the already booked dates. I have a table called conference_room_status which has the fields Conference_Room_Name | BookedPerson | DateFrom | DateTo | TimeFrom | TimeTo where DateFrom and DateTo (date format) is the starting and ending date of the reservation... and the person may need the conference room only between TimeFrom and TimeTo (time format)... Any ideas of how to write an sql query to retrieve these records will be greatly appreciated

Member Avatar
Member Avatar
+0 forum 4

Can anyone provide a quick solution for INSERT the entire excel sheet into a access database. This is a click button event that just opens a excel sheet in a windows form. What I like to see is some example how to INSERT the same excel data into a access db table within this click event. If possible within the same SQL query. [code] private void openToolStripButton_Click(object sender, EventArgs e) { openFileDialog(); } private void openFileDialog() { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { System.Data.DataSet myDataSet; System.Data.OleDb.OleDbDataAdapter MyCommand; openFileDialog.Filter = "Microsoft Excel|*.xls|Microsoft Access|*.mdb"; openFileDialog.InitialDirectory = "c:\\"; openFileDialog.Title = "Select file"; …

Member Avatar
Member Avatar
+0 forum 16

The End.