Connecting VB to OpenOffice database

I am attempting to connect from VB2008 to OpenOffice.
So the connection to Microsoft is
Create connection string to connect to
' -- an OleDB Data provider
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConnection = sConnection & "User ID=admin;"
sConnection = sConnection & "Data Source="
sConnection = sConnection & application.StartupPath & _
" camerashop.mdb"
Do I have to change both the Provider and StartupPath or just 1
Posted On: Thursday, November 29, 2012 Total Views: 139
View Complete with Replies

Related Messages:

connecting to database assist  (5 Views)
what's up guys.
i can't seem to add to records on the one row i receive the error message saying "Column count does not match value count at row 1"
but it works when i only add one record. Imports MySql.Data.MySqlclient
Public Class PatientInfo
Dim ServerString as String = "; User Id=sappracticedb; Password=Password1; Database=sappracticedb"
Dim SQLConnection as MySqlConnection = New MySqlConnection
Private Sub PatientInfo_Load(ByVal sender as System.Object ByVal e as System.Eventargs) Handles MyBase.Load SQLConnection.ConnectionString = ServerString
If SQLConnection.State = ConnectionState.Closed Then
MsgBox("Successfully Connected")
MsgBox("Connection is Closed.")
End If
Catch ex as Exception
End Try
End Sub
Private Sub Button2_Click(ByVal sender as System.Object, ByVal e as System.Eventargs) Handles btnClear.Click
'return the focus to txtFName
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEXIT.Click
'end the software by closing the window
End Sub
Public Sub SaveNames(ByRef SQLStatement As String)
Dim cmd As MySqlCommand = New MySqlCommand
With cmd
.CommandText = SQLStatement
.CommandType = CommandType.Text
.Connection = SQLConnection
End With
MsgBox("Successfully Added ")
End Sub
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
Dim SQLStatement As String = "INSERT INTO users(fName,lName) VALUES('" & txtFName.Text & txtLName.Text & " ')"
End Sub
End Class
View Replies !
connection string for connecting to databases  (2 Views)
can u please assist me regarding connection strings.
what do connection strings depend on like is there various strings on the basis of access version u use or on the .net framework used.. or is there a few other criteria
I amade a project with vb 2010 .net framework 4.0, access 2007 (.accdb), using Microsoft.aCE.OLEDB.12.0 as Provider
i want to make it execute on a system with no vb, .net framework 4.0, access 2003 (.mdb)
the same provider does not work on the system i want to make it work on. how should i change the connection string
View Replies !
Error message message when connecting to remote server  (9 Views)

Please assist. I receive error message msg "Logon Failure : Unknown user name or bad password" but the credentials I have supplied are correct
code:Private Sub Button2_Click(ByVal sender as System.Object ByVal e as System.Eventargs) Handles Button2.Click
Dim strdomainname, strusername, strpassword, strremoteServerName as String
Dim password as New Security.SecureString
Dim command as New Process
strremoteServerName = ""
strusername = "secretftp"
strpassword = "secptptf"
strdomainname =
For Each strchar as Char In strpassword.ToChararray
Dim impersonator as New aliasaccount(strusername, strpassword)
command.StartInfo.FileName = "201210091530_3618.txt"
command.StartInfo.Arguments = " " & strremoteServerName & " Minnes done"
command.StartInfo.UserName = strusername
command.StartInfo.Password = password
command.StartInfo.Domain = strdomainname
command.StartInfo.Verb = "open"
command.StartInfo.UseShellExecute = False
End sub

View Replies !
connecting PostgreSQL to  (3 Views)
i want to connect to postgresql. I had this code snippet.. and i always receive the error message "The 'PostgreSQL.1' provider isn't registered on the local machine.".. How could i correct this one given below is my whole codes; and honestly i do not know the exact steps.. tnx
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(ByVal sender as System.Object ByVal e as System.Eventargs) Handles MyBase.Load
'Dim oOleDbConnection as OleDbConnection
Dim con as String = "Provider=PostgreSQL.1;Data Source=;location=grocery;User ID=postgres;password=123;timeout=1000;"
Dim MyConnection as New OleDbConnection(con)
Catch ex as Exception
End Try
End Sub
End Class
, The local machine does not have the provider installed.
I'd advise using a native client rather than OleDb anyway:
http: connectionstr...roviders npgsql
View Replies !
Creating Log-In page connecting access Database  (4 Views)
I want a assist to create a log in Page.
I'm doing my work in VB express 2008. I'm attempting to connect it to my access 2007 Database so a user can log in with ther username and password, if tare using valid username password.
I've connected my access 2007 database using Data Source window: data->show data sources->add new data source.
Is this the correct way to connect database for my Log-In page
I really do not know what to do from here.
Can anyone please guide me
Here's my code snippet so far, and I've attached my GUI, so u can easily view what I'm attempting to do.Public Class Loginform
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles newuserLinkLabel.LinkClicked
End Sub
Private Sub okButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles okButton.Click
Dim userName As String = usernameTextBox.Text
Dim password As String = passwordTextBox.Text
if (userName.Length <> 0) Then
--------------> what code do I want here to check if a user typed the correct username that matches the data in db ---------------------
MessageBox.Show(Me, "Pls complete the info.", "Login Error message")
End If
End Sub
Private Sub ClearButton_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
Me.usernameTextBox.Text = ""
Me.passwordTextBox.Text = ""
End Sub
End Class
Attached image(s)

View Replies !
connecting wireless with and mysql  (6 Views)
I amade this cellphone application in and I want to ask if this application is possible to connect with 2 laptops using an ad hoc connection and communicate with each other with my cellphone application using their own databases i am recently using 2008 and sql server management studio express or any link u can direct me if possible thank u
This post has been updated by cj777: 20 March 2012 - 05:55 aM
View Replies !
connecting to database  (4 Views)
I am using visual studio 2008 and am attempting to connect to a database to search by car names. It will not connect to the database and says all my syntax is correct. can somebody please double check i am drawing a complete blank. Thanks TimPublic Class Form1
Dim ODBconnection as OleDb.OleDbConnection
Dim ODBda as New OleDb.OleDbDataadapter
Dim dt as New DataTable
Dim rowindex as Integer
Private Sub Form1_FormClosing(ByVal sender as Object, ByVal e as System.Windows.Forms.FormClosingEventargs) Handles Me.FormClosing
End SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim filepath As String
filepath = Software.StartupPath() & " Cars.mdb"
ODBconnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDB.4.0; Data Source= Cars.mdb")
ODBda.SelectCommand = New OleDb.OleDbCommand
ODBda.SelectCommand.CommandText = "Select * from Vehicle where Inv_ID = '" & dt.Rows(rowindex)("Inv_ID") & "'"
ODBda.SelectCommand.Connection = ODBconnection
ODBconnection = Nothing
End Try
Dim colorarray() As Color = {Color.Blue, Color.Green, Color.Coral, Color.Yellow, Color.SlateGray, Color.Firebrick, Color.Purple, Color.Gray, Color.Black}
Dim savedcat As String = dt(0)("Inv_ID")
Dim catarray() As String = {savedcat}
Dim catcount As Integer = 0
For Me.rowindex = 0 To dt.Rows.Count - 1
DataGridView1.Rows.add(dt(rowindex)("Inv_ID"), dt(rowindex)("manuf_ID"), dt(rowindex)("model"), dt(rowindex)("carsize"))
If dt(rowindex)("Inv_ID") <> savedcat Then
catcount += 1
savedcat = dt(rowindex)("Inv_ID")
ReDim Preserve catarray(catcount)
catarray(catcount) = savedcat
End If
DataGridView1.Rows(DataGridView1.Rows.Count - 1).DefaultCellStyle.BackColor = colorarray(catcount)
Next rowindex
Dim b As Button
Dim l As Integer = 710
Dim t As Integer = 0
For i = 0 To catarray.Count - 1
b = New Button
With b
.Name = "b_" & i
.Text = catarray(i)
.Size = New Size(62, 40)
.Location = New Point(l, t)
.Tag = catarray(i)
t = t + 45
.Visible = True
.BackColor = colorarray(i)
End With
AddHandler b.Click, AddressOf b_click
End Sub
Private Sub b_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim cat As String = DirectCast(sender, Button).Tag
For Each row As DataGridViewRow In DataGridView1.Rows
If row.Cells.item(0).Value = cat Then
DataGridView1.CurrentCell = row.Cells(0)
DataGridView1.FirstDisplayedCell = DataGridView1.CurrentCell
DataGridView1.CurrentCell = Nothing
End If
Next row
End SubPrivate Sub upbutton_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles upbutton.MouseDown
uptimer.enabled = True
End Sub
Private Sub downbutton_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles downbutton.MouseDown
downtimer.enabled = True
End Sub
Private Sub upbutton_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles upbutton.MouseUp
uptimer.enabled = False
End Sub
Private Sub downbutton_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles downbutton.MouseUp
downtimer.enabled = False
End Sub
Private Sub uptimer_tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles uptimer.tick
If DataGridView1.FirstDisplayedScrollingRowIndex > 0 Then
DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex - 1
End If
End Sub
Private Sub downtimer_tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles downtimer.tick
If DataGridView1.FirstDisplayedScrollingRowIndex
View Replies !
connecting database  (10 Views)
Pls tell me how can i normalize data in database during connection
View Replies !
connecting forms to sqlserver database using  (3 Views)
i am newbie to dot net....m attempting to access sqlserver management studio database using forms in using a button and i want to receive access to the database when i click on that button....the code snippet is given given below....wen i tried the same code with out using formsthis is working fine but it isn't working when i use forms....
Imports System.Data.Sqlclient
Public Class Form1
Private Sub Button1_Click(ByVal sender as System.Object, ByVal e as System.Eventargs) Handles Button1.Click
Dim strcon as String = "Data Source=. sqlexpress;Initial Catalog=employee;Integrated Security=True"
Dim con as SqlConnection
Dim cmd as SqlCommand
Dim dr as SqlDataReader
con = New SqlConnection(strcon)
cmd = New SqlCommand("select * from employee", con)
dr = cmd.ExecuteReader()
While dr.Read()
End While
End Sub
End Class
m not getting any output using this code....please tell me where i went wrong...Pls assist me...It's urgent
View Replies !
connecting over vpn  (9 Views)
Not really sure if this should go here.
I have an app that connects to a sql database using the standard connection string.
Now i want to do some work on this at home where i have a vpn connection to work setup. It is quicker to work locally than it is to rdp into work and work from my desktop there. What do i want to append to the connection string to receive it to connect to the server at work I have tried appending the domain in front of the server name but that did not work. is there some thing else i should doserver=domain servername

This post has been updated by Damage: 08 July 2011 - 02:56 aM
View Replies !
connecting to SQL server 2000 database from  (3 Views)
I am newbie in Visual
Recently I have been given a project to design a database for college in that record of all the students and college staff will be stored i have the interface in but now when i want to make a connection to sql server 2000 database i am sufering from many difficulties.
Will any body assist me
Waiting for early response
View Replies !
connecting CrossTab Query in access and  (11 Views)
hii everyone
i am attempting to generate a school time table by using access and ,as u know time table containing from PERIOD'S NO. as column heading and the DaYS as row headings,,,,,, and to do so , in access i used a type of query called CrossTab, the difficulty these kind want a parameter (e.g: it asked me to type the class section to open it is Timetable ) that lead me to face difficulty in connecting it with ...... anyone can assist me in this OR advise another solution.
This post has been updated by a6yaf: 17 February 2010 - 07:34 aM
View Replies !
connecting a vb application to a sql server database  (4 Views)
i am attempting to develop an application in vb and wish to connect it to an sql server 2000 database.
What is the code snippet to do this.
View Replies !
Error message message message when connecting to a SQL Express 2005 Database  (4 Views)
I have been tryng to establish a new data source for a windows form 'clients'.
So after starting the 'Data Source Configuration Wizard', and successfully connecting to the Database (test connection returned OK) I saved the connection string.
I then clicked on Next and the wizard successfully retrieved the Database Objects. I expanded the Tables node and selected the clients table.
I then clicked on the Finish button and after a few seconds, an error message message came up as follows:
an error occurred while creating the new data source:
View Replies !
connecting a web application in vb 2005 to populate an access database  (5 Views)
my name is skarabaganza as yu can view anyway am a student studying proigramming and am used to doing windows applications in vb 2005 the only difficulty i have is that i cant seem to find the oledb data adapter in the web application utility box have i done some thing wrong and can anyone shed some light on this.
View Replies !
VB.NET: connecting to MySQL  (3 Views)
Is there any way to connect to a MySQL server Because I want to connect to my database that has a list of usernames and keycodes that will allow that person into my Program.
So a list of commands functions that would allow me to connect and receive the table data and than disconnect would be nice.
This post has been updated by Warlox89: 20 May 2008 - 07:53 PM
View Replies !
connecting with access  (3 Views)
i have to do a hospital mangment system by and connec it with a Database and i do that by using Wizard the problme is that i don't know how i can validat the data thet the user will enter it and i do not know how can i provide each patient and staff member a uniqe ID and send it to the Database
so please can anyone assist me
View Replies !
connecting more than one forums  (7 Views)
create an application that works as a shopping cart system. u will have a main form that contains a listbox that represents a shopping cart a form with a listbox for print books, a form with a listbox for audio books, and a easy about box.
I tried to do it like this...
Private Sub btnadd_Click(ByVal sender as System.Object, ByVal e as System.Eventargs) Handles btnadd.Click
Dim strselected as String
'Dim lstshoppingcart as String
strselected = lstPrint.Selecteditem.ToString()
Dim MainForm as New frmMain
End Sub
this selected item on the listbox 'print' should be added to the listbox of main form.
I tried but failed. Pls assist me
This post has been updated by deed: 16 November 2009 - 06:32 aM
View Replies !
connecting access database to and validation  (6 Views)
I have an access database containing fruit names and its quantity. I have to connect this to My appln also asks for personal data like Name, address, Date, Zipcode, Email id and more. I have to validate each entry as well. Here are few things that i want to know:
1) For the date validation, it should pass certain formats like MM DD YYYY, DD MM YYYY and more..wherein i should account for leap years. I have used a logic but i don't know how i should pull out the YYYY part of the Regular expression() to validate the year. (Should check if its divisible by 4 and then 100 and then 400).
2) For the database connection, i have done what i knew (selected a grid see, browsed and connected the db) but it doesnot accept the fruits name to show that its available in the db. Please inform me what i should be doing for this. Also my software shouldn't only show the fruit entered by the user with its respective quantity, it should also pass its plurals i.e should pass both apple and apples (another E.g. also berry and berries) though It's only apple in the db.
Here's my code. I'm not so proficient in this topic. So detailed assist would be comprehended.
Here's default.aspx.vb
Imports System.Data.OleDb
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Validating the Name field'
If TextBox1.Text.Length = 0 Then
Label2.Text = "Name should contain atleast one character"
Label2.Text = ""
End If
'Validating the Address field'
If TextBox2.Text.Length = 0 Then
Label4.Text = "Address should contain atleast one character"
Label4.Text = ""
End If
'Validating the Zipcode'
Dim zipcheck As New Regular expression("^ d{5}$|^ d{5}[-] d{4}$|^ d{9}$|^ d{5} d{4}$|^ d{5} [-] d{4}$")
If Not zipcheck.IsMatch(TextBox3.Text) Then
Label6.Text = "Zipcode should follow format"
Label6.Text = ""
End If
'Validating Email address'
Dim emailcheck As New Regular expression("^[A-Za-z0-9]+([_.]{1}[A-Za-z0-9]+)*@[A-Za-z0-9]+([_.]{1}[A-Za-z0-9]+)* .[A-Za-z]{2,3}$")
If Not emailcheck.IsMatch(TextBox4.Text) Then
Label8.Text = "Incorrect Email address format entry"
Label8.Text = ""
End If
'Validating Date'
Dim datecheck As New Regular expression("^ d{2} d{2} d{4}$|^ d{2} d{2} d{4}$|^ d{1} d{1} d{4}$|^ d{2}[-] d{2}[-] d{4}$|^ d{2} ([a-zA-Z]+) d{4}$|^[a-zA-Z]{3} d{2} d{4}$")
If Not datecheck.IsMatch(TextBox5.Text) Then
Label10.Text = "Incorrect Date format entry"
ElseIf Not IsDate(TextBox5.Text) Then
Label10.Text = "Incorrect Date format entry..should enter as MM DD YYYY only "
Label10.Text = ""
End If' Using System.Data.OleDb
Dim conn = New OleDbConnection() 'to generate a connection Object
' to connect to ur db
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C: Users kashyap Documents Visual Studio 2005 WebSites proj1 Application_Data fruits.mdb"
' open the connection

Dim cmd As OleDbCommand = New OleDbCommand("fname", conn)
' close the connection with

'Validating Fruit entry
Dim fruitcheck As New Regular expression("^[a-zA-Z]*&")

If Not fruitcheck.IsMatch(cmd.CommandText) Then
Label12.Text = "Fruit not found in the db"
Label12.Text = ""
End If
End Sub
End Class

View Replies !
Error message message message when connecting to a SQL Express 2005 Database  (4 Views)
VS2005 attempting to generate a dataset for an MSaccess I receive this error message:
Microsoft Visual Studio
an error occurred while creating the new data source:Could not receive type information for 'DeviceapplicationSamp.TempDBDataSet'.
OK Assist
---------------------------DeviceapplicationSamp is my application name
View Replies !