Search Results

Search found 331 results on 14 pages for 'oledb'.

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • Print ms access data in vb.net

    - by user225269
    How do I print the ms access data(.mdb) in vb.net? Here is the code that I'm using to view the data in the form. What I want to do is to be able to print what is currently being viewed. Perhaps automatically save the .pdf file and the pdf viewer installed on the system will open that newly generated pdf file Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb") Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn) cn.Open() Dim rdr As OleDbDataReader rdr = cmd.ExecuteReader If rdr.HasRows Then rdr.Read() NoAcc = rdr("NAME") If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER") If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT") If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE") End If -some sites for beginners regarding this topic would help a lot:)

    Read the article

  • How to SET ARITHABORT ON for connections in Linq To SQL

    - by Laurence
    By default, the SQL connection option ARITHABORT is OFF for OLEDB connections, which I assume Linq To SQL is using. However I need it to be ON. The reason is that my DB contains some indexed views, and any insert/update/delete operations against tables that are part of an indexed view fail if the connection does not have ARITHABORT ON. Even selects against the indexed view itself fail if the WITH(NOEXPAND) hint is used (which you have to use in SQL Standard Edition to get the performance benefit of the indexed view). Is there somewhere in the data context I can specify I want this option ON? Or somewhere in code I can do it?? I have managed a clumsy workaround, but I don't like it .... I have to create a stored procedure for every select/insert/update/delete operation, and in this proc first run SET ARITHABORT ON, then exec another proc which contains the actual select/insert/update/delete. In other words the first proc is just a wrapper for the second. It doesn't work to just put SET ARITHABORT ON above the select/insert/update/delete code.

    Read the article

  • reading excell file in vb.net

    - by Mark
    can anyone help me on how to know EOF of excel using vb.net? i have this code but it crash when i try delete the proceeding rows from row 6 to downward. my problem is, my code was still reading a null values of rows that i deleted in excel.. this is my code: Dim xlsConn As New OleDbConnection Dim xlsAdapter As New OleDbDataAdapter Dim xlsDataSet As New DataSet xlsConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0") strSQL = "SELECT * FROM [Sheet1$]" xlsAdapter.SelectCommand = New OleDbCommand(strSQL, xlsConn) xlsDataSet.Clear() xlsAdapter.Fill(xlsDataSet) ListView1.Items.Clear() Dim listItem As ListViewItem For ctr As Integer = 0 To xlsDataSet.Tables(0).Rows.Count - 1 listItem = ListView1.Items.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpNo").ToString) listItem.SubItems.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpName").ToString) Next Can anyone help me to fix this bugs!

    Read the article

  • Access Database connect C# local director

    - by Bomboe Cristian
    I want my connection to the database to be available all the time, so if i move the folder with the project, to an other computer, the connection to be made automaticaly. So, how can i change this connection: this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"C:\\Documents and Settings\\Cristi\\Do" + "cuments\\Visual Studio 2008\\Projects\\WindowsApplication3\\bd1.mdb\""; ??? It should read the project directory or something. I don't know. Any ideas? Thank You!

    Read the article

  • How To Get A Field Value Based On The Max Of Another Field In VFP v8.0

    - by DaveB
    So, I have a table and I want to get the value from one field in the record with the greatest DateTime() value in another field and where still another field is equal to a certain value. Example data: Balance Created MeterNumber 7924.252 02/02/2010 10:31:48 AM 2743800 7924.243 02/02/2010 11:01:37 AM 2743876 7924.227 02/02/2010 03:55:50 PM 2743876 I want to get the balance for a record with the greatest created datetime for a specific meter number. In VFP 7 I can use: SELECT a.balance ,MAX(a.created) FROM MyTable a WHERE a.meternumber = '2743876' But, in the VFP v8.0 OleDb driver I am using in my ASP.NET page I must conform to VFP 8 which says you must have a GROUP BY listing each non aggregate field listed in the SELECT. This would return a record for each balance if I added GROUP BY a.balance to my query. Yes, I could issue a SET ENGINEBEHAVIOR 70 but I wanted to know if this could be done without having to revert to a previous version?

    Read the article

  • MS Word: Mailmerge hyperlinks with query get url string with a mergefield.

    - by oterrada
    Hi, I'm trying to send an email merging one document (docx) with a contacts database (via OleDB). Using MSWord2007, it seems easy (it works for easy things: name, address, ...) but I can't find how fill an query-get url string with a merge field inside an hyperlink. An hyperlink like: Click here where here is an hyperlink to http://domain.com/[email protected] where [email protected] is the address of the contact, a merge field. I've tried the special/merge fields: {HYPERLINK "http://domain.com/test.php?contact={MERGEFIELD contactEmail}" \o "Here"} but it doesn't work, sometimes it merge only the first record and then send all the mails with the same address, I got this alternating the view with ALT+F9. This support doc doesn't work for me because I don't have the complete URL in my database for each contact, and I can't change the design of the table or add a view (it's from the CRM), I don't like to do it exporting the table and adding the field. Any idea? Thanks in advance,

    Read the article

  • Push or Pull to Excel for reporting data

    - by Nathan Fisher
    I am unsure which is the best way to go here. I have a third party Excel 2003 spreadsheet that needs to be filled in on a monthly basis and emailed. Currently it is a manual process and I am in the process of automating the generation of the spreadsheet. I have been throwing around different ideas of how to get the data into the spreadsheet. I have thought of using SSRS to create a report that is in a similar format and get the user to cut and past. Alternatively writing a VBA addin that retrieves that data from a webservice and then adds the data to the spreadsheet. Or using the third party spreadsheet as a template and open it on the server via oledb and adding the data then serving it as a downloadable file. Which is better or are the better solutions out there?

    Read the article

  • How to determine Jet database Engine Type programmatically

    - by MZB
    I have a program which needs to upgrade any Access (Jet) database it opens to JET Version4.x if it isn't already that version. (This enables use of SQL-92 syntax features) Upgrading is (relatively) easy. A call to the JRO.JetEngine object's CompactDatabase method (as described here) should do the trick, but before I do this I need to determine whether an upgrade is required. How do I determine the Jet OLEDB:Engine Type of an existing database? Can this be determined from an open OleDBConnection? Note: I'm talking about database versions, not Jet library versions. C# or .Net solution greatly appreciated.

    Read the article

  • VB6 ADODB Fails with SQL Compact: Multipe-Step operation generated errors

    - by Belliez
    Hi, I am converting an old application to use SQL Compact database (it works ok with SQ Server 2005 and 2008) and using the following code gives an error when attempting to execute a simple select command: Private Const mSqlProvider As String = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;" Private Const mSqlHost As String = "Data Source=C:\database.sdf;" Private mCmd As ADODB.Command ' For executing SQL' Private mDbConnection As ADODB.Connection Private Sub Command1_Click() Dim DbConnectionString As String DbConnectionString = mSqlProvider & _ mSqlHost Set mDbConnection = New ADODB.Connection mDbConnection.CursorLocation = adUseClient Call mDbConnection.Open(DbConnectionString) If mDbConnection.State = adStateOpen Then Debug.Print (" Database is open") ' Initialise the command object' Set mCmd = New ADODB.Command mCmd.ActiveConnection = mDbConnection End If mCmd.CommandText = "select * from myTable" mCmd.CommandType = adCmdText mCmd.Execute ' FAILS HERE! ' End Sub I have referenced Microsoft ActiveX Data Access Object 6.0 Library in the project. The error I get is: Run-Time error -2147217887 (80040e21) Multipe-Step operation generated errors. Check each status value Just wondering if anyone has any suggestions? Thanks

    Read the article

  • connection string reading data from excel in asp.net

    - by Greg
    Hello, I am trying to read data from excel file in asp.net. I have added the connection string to webConfig file: <add name="xls" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HPM_DB.xls;Extended Properties=Excel 8.0"/> But it shows me an errormessage when I run this query: string query = "Select * from [IO_Definition$]"; IO_Definition is the name of the spreadsheet in my excel file. I also added the excel file to the App_Data folder of the website. The error is: The Microsoft Jet database engine could not find the object 'IO_Definition$'. Make sure the object exists and that you spell its name and the path name correctly. The thing is, when I write the absolute path of the excel file in the connectionString it does work. Is there anyway I can make it work without writing the absolute path? Thanks, Greg

    Read the article

  • VB.NET - ASP.NET - MS-Access - SQL Statement

    - by Brian
    I have a button which when pressed, sets the user's rights in the db. (If Administrator UserTypeID is set to '2' and if Customer it is set to '1'). However when I run the below code, everything remains the same. I think it's from the SQL statement but I;m not sure. Can anyone help please? Protected Sub btnSetUser_Click(sender As Object, e As System.EventArgs) Handles btnSetUser.Click Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Brian\Documents\Visual Studio 2010\WebSites\WebSite3\db.mdb;") Dim cmd As OleDbCommand = New OleDbCommand("UPDATE [User] SET [UserTypeID] WHERE Username=?", conn) conn.Open() cmd.Parameters.AddWithValue("@Username", txtUser.Text) If ddUserType.SelectedItem.Text = "Administrator" Then cmd.Parameters.AddWithValue("@UserTypeID", "2") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Administrator." ElseIf ddUserType.SelectedItem.Text = "Customer" Then cmd.Parameters.AddWithValue("@UserTypeID", "1") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Customer." End If conn.Close() End Sub End Class

    Read the article

  • In native C++, how does one use a SqlCe .sdf database?

    - by Omer Sabic
    Is there a simple way, without .NET? I've found some libraries but none for SqlCe 3.5. There is http://sqlcehelper.codeplex.com/ but it's far from done, since a major feature like using a password is not yet implemented. I've looked at the source and it uses OLEdb to handle the database. The offical Microsoft Northwind example (that is shipped with SQL Compact 3.1, but not with 3.5) also doesn't work, I've tried setting it up with no success. Actually I don't have a sample working code. Was anyone able to set it up paired with a passworded .sdf? What are the alternatives? Thanks.

    Read the article

  • Vb.net on running shows updation exception

    - by harun123
    I've a website in vb.net. While running the website i get the following error: "Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype." My DB connection.inc file looks as follows: <%@ Import namespace="ADODB" % Dim strDataSource As String Dim cnnCRM As ADODB.Connection <% cnnCRM = New ADODB.Connection strDataSource = Server.MapPath(".") & "/database/crm.mdb" 'strDataSource="c://crm/crm.mdb" cnnCRM.Open("PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strDataSource) % I've tried giving the record set object all the properties it required. Still the same error. Can anybody tell me how i can get rid of this error?.....

    Read the article

  • ADO Error: Automation error - The specified module could not be found

    - by KerryF
    My VB6 application which runs successfully on many machines is producing the above error on just 1 users machine. Machine has Vista SP1 which means the MDAC installer will not work since MDAC 2.8 is already included. Code that leads up to the error: 'Temp file to users temp directory: FileName = C:\DOCUME~1\nmiller\LOCALS~1\Temp\TmpPrint.mdb Dim catADO As New ADOX.Catalog catADO.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileName Error happens on the .Create line. Any help getting this user going would be greatly appreciated!

    Read the article

  • ADO "Unspecified Error" instead of actual error when fetching server side cursor

    - by Dan
    This relates to my recent question: http://stackoverflow.com/questions/2835663/force-oracle-error-on-fetch I am now able to reproduce a scenario where using ADO with the Oracle OLEDB Provider, I can force an error such as ORA-01722: invalid number to occur on calling Recordset.MoveNext However, this is not the error that is returned to the application. Instead, the application sees Provider error '80004005' Unspecified error. How can I get the application to see the real error from the database? This is with Oracle 10g (client and server), if it matters. Sample code is roughly as follows: Dim con As New ADODB.Connection Dim cmd As New ADODB.Command Dim rs As ADODB.Recordset con.ConnectionString = "Provider=OraOLEDB.ORACLE;Data Source=xxx;User Id=yyy;Password=zzz" con.CursorLocation = adUseServer con.Open Set cmd.ActiveConnection = con cmd.CommandText = "select * from table(ret_err)" cmd.Prepared = True Set rs = cmd.Execute While Not rs.EOF rs.MoveNext Wend

    Read the article

  • "Data type mismatch in criteria expression"

    - by simon
    Hey guys ! I have a problem when i want to insert values from textboxes to my access database ! When i want to save i get that error ("Data type mismatch in criteria expression") The code: string conString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\Users\Simon\Desktop\test5\test5\test5\save.mdb"; OleDbConnection empConnection = new OleDbConnection(conString); string insertStatement = "INSERT INTO aktivnosti_save " + "([ID_uporabnika],[ID_aktivnosti],[kalorij]) " + "VALUES (@ID_uporabnika,@ID_aktivnosti,@kalorij)"; OleDbCommand insertCommand = new OleDbCommand(insertStatement, empConnection); insertCommand.Parameters.Add("@ID_uporabnika", OleDbType.Char).Value = textBox3.Text; insertCommand.Parameters.Add("@ID_zivila", OleDbType.Char).Value = iDTextBox.Text; insertCommand.Parameters.Add("@kalorij", OleDbType.Char).Value = textBox2.Text; empConnection.Open(); try { int count = insertCommand.ExecuteNonQuery(); } catch (OleDbException ex) { MessageBox.Show(ex.Message); } finally { empConnection.Close(); textBox1.Clear(); textBox2.Clear(); } }

    Read the article

  • Syntax error in INSERT INTO statement

    - by Amit Kr. Ghosh
    conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\database.mdb"); conn.Open(); com = new OleDbCommand(@"insert into group (groupid,groupname,nature,effect) values (@groupid,@groupname,@nature,@effect)", conn); com.Parameters.AddWithValue("@groupid", intialtxt); com.Parameters.AddWithValue("@groupname", groupnametxt); com.Parameters.AddWithValue("@nature", groupnaturecombo); com.Parameters.AddWithValue("@effect", efectivegroupcombo); com.ExecuteNonQuery(); conn.Close() i have write this connection ,but i get one error Syntax error in INSERT INTO statement please someone help me.

    Read the article

  • C# database file directory

    - by Simon
    I'm using the windows forms aplication with an ms access database. And i would like to know if there is a way to show the directory of the database file (to save data in it)excpet like this: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=save.mdb"; or this: "Data Source=D:\Simonova aktovka na namizju\matura\test5\save.mdb"; couse if i use the first one the aplication undos the changes i've made when i close it(the aplication) the second one makes me have to change the path everytime i bring the aplication to another computer(cous the direktory is different of coars) So... is there another way?

    Read the article

  • How to connect to a SQLite database in iphone

    - by Lee
    I am attempting converting an application from VB6 to an iphone app. In the VB version, the database is in Access. But, I have read that I need to convert it to SQLite. How I amend the following code to switch from Access to SQLite? cnList = new ADODB.Connection(); rsList = new ADODB.Recordset(); cnList.Provider = "Microsoft.Jet.OLEDB.4.0;"; cnList.ConnectionString = "Persist Security Info=False;"+CString("Data Source=cbe.mdb"); cnList.Open();

    Read the article

  • How to catch specific exception without error number?

    - by CJ7
    I need to catch the following specific exception: System.Data.OleDb.OleDbException was caught ErrorCode=-2147467259 Message="The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again." Source="Microsoft JET Database Engine" I'm not sure what ErrorCode is but it looks unreliable. Can I rely on Message being identical across platforms? Is the only solution to do a text search of Message for words like duplicate and primary key? Note: see my question here for why I need to catch this exception.

    Read the article

  • reading excel file in vb.net

    - by Mark
    can anyone help me on how to know EOF of excel using vb.net? i have this code but it crash when i try delete the proceeding rows from row 6 to downward. my problem is, my code was still reading a null values of rows that i deleted in excel.. this is my code: Dim xlsConn As New OleDbConnection Dim xlsAdapter As New OleDbDataAdapter Dim xlsDataSet As New DataSet xlsConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0") strSQL = "SELECT * FROM [Sheet1$]" xlsAdapter.SelectCommand = New OleDbCommand(strSQL, xlsConn) xlsDataSet.Clear() xlsAdapter.Fill(xlsDataSet) ListView1.Items.Clear() Dim listItem As ListViewItem For ctr As Integer = 0 To xlsDataSet.Tables(0).Rows.Count - 1 listItem = ListView1.Items.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpNo").ToString) listItem.SubItems.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpName").ToString) Next Can anyone help me to fix this bugs!

    Read the article

  • SQL Access INSERT INTO Autonumber Field

    - by KrazyKash
    I'm trying to make a visual basic application which is connected to a Microsoft Access Database using OLEDB. Inside my database I have a user table with the following layout ID - Autonumber Username - Text Password - Text Email - Text To insert data into the table I use the following query INSERT INTO Users (Username, Password, Email) VALUES ('004606', 'Password', '[email protected]') However I seem to get an error with this statement and according to VB it's a syntax error. But then I tried to use the following query INSERT INTO Users (Username) Values ('004606') This query seemed to work absolutely fine... So the problem is I can insert into just one field but not all 3 (excluding the ID field because it's an autonumber). Any help would be appreciated, Thanks

    Read the article

  • How to populate gridview on button_click after searching from access database?

    - by Usman
    I am creating a form in c#.net . I want to populate the gridview only on button click with entries meeting search criteria. I have tried but on searching ID it works but on searching FirstName it gives error plz check SQL also. My Code behind private void button1_Click(object sender, EventArgs e) { try { string strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=L:/New project/Project/Project/Data.accdb"; string sql = "SELECT * FROM AddressBook WHERE FirstName='" + textBox1.Text.ToString(); OleDbConnection connection = new OleDbConnection(strConn); OleDbDataAdapter dataadapter = new OleDbDataAdapter(sql, connection); DataSet ds = new DataSet(); connection.Open(); dataadapter.Fill(ds, "AddressBook"); connection.Close(); dataGridView1.DataSource = ds; dataGridView1.DataMember = "AddressBook"; } catch (System.Exception err) { this.label27.Visible = true; this.label27.Text = err.Message.ToString(); } }

    Read the article

  • "SQL Server does not exist or access denied." upon VB.Net Deployment

    - by JasonMHirst
    Have built a small VB.Net app in VS2010. The connection string to the SQL Server is as follows: <connectionStrings> <add name="IWSR_DataDownloadWizard.My.MySettings.sqlConnection" connectionString="Provider=SQLOLEDB.1;Data Source=SQLServer;Integrated Security=SSPI;Initial Catalog=IWSROL" providerName="System.Data.OleDb" /> </connectionStrings> Within the VS2010 environment AND on my machine, the connection works perfectly, however when I deploy to clients I get an error message of: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. I've tried to search the net for solutions, have seen a few instances of people saying to NOT use the Server Name but the IP Address instead (this doesn't work) and some saying to remove the "Provider=SQLOLEDB.1", again this doesn't work. Can anyone suggest a solution please? Further information: Development System is Windows7 using VS2010 Deployment systems are a combination of Windows XP, Windows 2000 and Windows 7 SQL Server is SQL2000 (soon to be SQL2005). TIA

    Read the article

  • Vba to Access record Insert Issue

    - by raam
    I want to insert Values to access table by using VBA control is there is any simple way to do this. i try this code but it does not work properly if i run this code it give the error 'variable not set' can anyone help me. thanks in advance Private Sub CommandButton1_Click() Dim cn As ADODB.Connection Dim strSql As String Dim lngKt As Long Dim dbConnectStr As String Dim Catalog As Object Dim cnt As ADODB.Connection Dim dbPath As String Dim myRecordset As New ADODB.Recordset Dim SQL As String, SQL2 As String dbPath = "table.accdb" dbConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath & ";" SQL = "INSERT INTO Jun_pre (ProductName,DESCRIPTION,SKU,MT,(mt),MRP,Remark,no_of_units_in_a_case) VALUES (""aa"",""bb"",""test"",""testUnit"",""1"",""2"",,""3"",,""4"");" With cnt .Open dbConnectStr 'some other string was there .Execute (SQL) .Close End With End Sub

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >