Connecting VB to OpenOffice db

I'm 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 & Software.StartupPath & _
" camerashop.mdb"
Do I've to alter both the Provider and StartupPath or just 1
Posted On: Thursday, November 29, 2012 Total Views: 20
View Complete with Replies

Related Messages:

connecting to database help  (1 Views)
what's up guys.
i can not 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; Db=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  (1 Views)
can u pls assist me regarding connection strings.
what do connection strings depend on like is there various strings based on access version u use or on the .net framework used.. or is there a few other criteria
i made 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 alter the connection string
View Replies !
Error when connecting to remote server  (1 Views)

Pls help. I receive error message msg "Logon Failure : Unknown user name or bad password" but the credentials I've 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  (2 Views)
i need 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 system.".. 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 system 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  (3 Views)
I want a assist to generate a log in Page.
I'm doing my work in VB express 2008. I'm attempting to connect it to my access 2007 Db so a user can log in with ther username and password, if tare using valid username password.
I've connected my Access 2007 db using Data Source window: data->show data sources->add new data source.
Is this the correct way to connect db for my Log-In page
I really do not know what to do from here.
Can anybody pls guide me
Here's my code snippet so far, and I've attached my GUI, so u can effortlessly 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  (4 Views)
i made this cellphone software in and I want to ask if this software is possible to connect with 2 laptops using an ad hoc connection and communicate with each other with my cellphone software using their own databases I'm 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  (3 Views)
I am using visual studio 2008 and am attempting to connect to a db to search by car names. It will not connect to the db and says all my syntax is correct. can somebody pls 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  (8 Views)
Pls tell me how can i normalize data in db during connection
View Replies !
connecting forms to sqlserver database using  (2 Views)
I'm newbie to dot net....m attempting to access sqlserver management studio db using forms in using a button and i need to receive access to the db 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  (6 Views)
Not really sure if this should go here.
I have an application that connects to a sql db 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  (2 Views)
I am newbie in Visual
Recently I've been given a project to design a db for college in that record of all the students and college staff will be stored I've the interface in but now when i need to make a connection to sql server 2000 db i am sufering from several difficulties.
Will i need some help
Waiting for early response
View Replies !
connecting CrossTab Query in access and  (1 Views)
hii everyone
I'm attempting to create a school time table by using access and ,as u know time table having 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 ...... anybody 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 software to a sql server database  (3 Views)
I'm attempting to develop a software in vb and wish to connect it to an sql server 2000 db.
What is the code snippet to do this.
View Replies !
Error message when connecting to a SQL Express 2005 Db  (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 many seconds, an error came up given bellow:
An error occurred while generating the new data source:
View Replies !
connecting a web software in vb 2005 to populate an access database  (2 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've is that i can not seem to find the oledb data adapter in the web software utility box have i done some thing wrong and can anybody shed some light on this.
View Replies !
VB.NET: connecting to MySQL  (2 Views)
Is there any way to connect to a MySQL server Because I want to connect to my db that has a list of usernames and keycodes that will let that person into my Program.
So a list of commands functions that would let 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  (2 Views)
I've 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 pls can anybody assist me
View Replies !
connecting more than one forums  (1 Views)
create a software 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 an 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  (2 Views)
I have an access db having fruit names and its quantity. I have to connect this to My appln also asks for private data like Name, Address, Date, Zipcode, Email address and more. I have to validate each entry as well. Here are few things that I wish 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 db 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 when connecting to a SQL Express 2005 Db  (2 Views)
VS2005 attempting to create a dataset for an MSAccess I receive this error message:
Microsoft Visual Studio
An error occurred while generating the new data source:Could not receive type info for 'DeviceApplicationSamp.TempDBDataSet'.
OK Assist
---------------------------DeviceApplicationSamp is my Software name
View Replies !