Visual Basic With SQL-database Connection And Windows XP
When you work with Visual Basic 2005 Express Edition on windows XP, and if your application contains references to SQL-databases, I have discovered that it is important that all identities be logged off before you open the particular identity where you want to work on your Visual Basic project. I have earlier assumed that it was only possible to work with Visual Basic on one identity, the one where the version was registered.
This assumption was not quite correct. Actually, you may run Visual Basic applications with SQL-references on all identities on XP, provided that no other identities that are using the SQL-server are currently running.
For example, suppose you start your computer and log on the identity James. Then you switch identity, but you actually don't log off James. Then you log on the John identity. There you discover that it is impossible to create a new SQL-database in Visual Basic's Data-connections view. An error message appears. Why is that? It is because the SQL-server is busy on the James-identity. To solve this problem you want to log off the John identity, don't just switch. Then log on the James identity again, and log off properly. All identities should now be logged off. Now you may log on the John identity again, and it is now possible to create an SQL database.
Concerning deploying applications for XP. This issue is similar to the one I just described. You cannot run the installation-file successfully on one identity if the SQL-sever is busy on another identity. You want to log off all identities before logging on the identity where you want to install the application. Same thing when you want to run the deployed application.
Question. Does this limitation exist only in the express-editions of Visual Studio 2005 as a drag on free-ware, or is it prevalent in commercial editions as well? I would like to know a little more about this before purchasing the standard or professional edition of Visual Studio 2005.
Best Regards
Ziper
View Complete Forum Thread with Replies
Related Forum Messages:
Windows Vista Business 64 And Microsoft Visual Basic 2008 Express Edition Bad Sqlceme35.dll
I watched and followed the Intro to VB 2008 Express, but in the final part of the video, when you add a database, i did everything as the video says, still i get: An error occurred creating the form. See Exception.InnerException for details. The error is: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) Ive tried the fix stated in another forum, the one about changing the "Target CPU" but the option doesn appear, what does appear its the "Platfrom" dropdown list, but its fixed to "Any CPU" and dont have any more options. Ive also downloaded Microsoft SQL Server Compact 3.5 ENU and "re-installed" and selected repair, followed the steps, rebooted and still nothing. The problem persists, any ideas, please?
View Replies !
I Need To Add A Row To A SQL CE Database If It Does Not Exists.I Am In Visual Studio 2005 Using Visual Basic 2005.
I need to add a row to a SQL CE database if it does not exists using Visual Basic 2005 in Visual Studio 2005. I can't seem to find the duplicate record using a tableadapter query. It adds the same record again. I am trying to use tableadapters, but do not have to. Any suggestions? Here is the add row code I am using... checkCustRow = PcDatabase1.MainToolData.NewMainToolDataRow() checkCustRow("Name") = "" checkCustRow("Size1") = cmbSize1 checkCustRow("Size2") = "" checkCustRow("Size3") = "" checkCustRow("Size4") = "" checkCustRow("Pressure1") = cmbPressure checkCustRow("Pressure2") = "" checkCustRow("Pressure3") = "" checkCustRow("Pressure4") = "" checkCustRow("Category") = "BOPs" checkCustRow("VSSName") = "BOPs.vss" checkCustRow("Type") = cmbType checkCustRow("Manufacturer") = "WFT" checkCustRow("Height") = cmbHeight checkCustRow("Width") = cmbWidth checkCustRow("Weight") = cmbWeight checkCustRow("VolumeOpen") = cmbOpen checkCustRow("VolumeClosed") = cmbClosed checkCustRow("EndConnection") = "" checkCustRow("Userdefined") = "T" PcDatabase1.Tables("MainToolData").Rows.Add(checkCustRow) Dim ta As New PCDatabaseTableAdapters.MainToolDataTableAdapter ta.Update(PcDatabase1.MainToolData) Any suggestions? Jeff
View Replies !
How To Create Sql Database In Visual Basic
First i am newbie in vb and Sql server... Is possible to create and attaching, via vb classic or VBA, a sql database in this instance:\DVD377-14D9E48CSQLEXPRESS... I have Sql Express. Database name: mydatabase Database Table: mytable fileds: fiedl1 text format fiedl2 text format fiedl3 text format fiedl4 date format fiedl5 number format fiedl6 text format
View Replies !
SQL Database - Hit Counter - Using Visual Basic In VWD
Let me get VERY specific. This site has 40+ pages Using VWD 2008 (Studio 2008) I have created in local IIS7 (129.0.0.2) http://cumc.lcl Navigation.master, Web.config and Web.sitemap alll are structured And all 40+ pages have been built. NOW I added (using VWD) a sql server database named pagedata.mdf With a table named: pages and fields: PageID - Primary Key (auto numbered) pagename - nchar(30) exmp Default hitcount - numeric(18,0) createdate - nchar(15) exmp 04/18/2008 updated - nchar(15) similar to createdate hitdate - nchar(15) similar to createdate bottom of each page is to show 99999 visitors and under that is to be Updated on mm/dd/yyyy On pageload should accomplish the following increment the hitcount field and save it and display it in HitLabel.text Set UpdateLabel.text to updated field Save the date the page was hit in hitdate field. (will only show when last hit) The "tester.aspx" page now has: <%@ Page Language="VB" MasterPageFile="~/Navigation.master" Title="tester" %> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) End Sub </script> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <p align="center">This page is for various tests<br />and will NOT be site mapped.</p> <p align="center"></p> <p align="center"> Can this SqlDataSource be moved into Sub Page_load above? How do I extract, process and save the Hit and Date data for each individual page referenced by pagename field? <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStringsageConnect %>" SelectCommand="SELECT * FROM [main] WHERE ([pagename] = @pagename)"> <SelectParameters> <asp:QueryStringParameter Name="pagename" QueryStringField="thispage" Type="String" /> </SelectParameters> </asp:SqlDataSource> </p> <p align="center"> <asp:Label ID="HitLabel" runat="server"></asp:Label> Visitors<br /> Updated on <asp:Label ID="UpdateLabel" runat="server"></asp:Label> </p> </asp:Content>
View Replies !
How To Create Sql Database In Visual Basic
First i am newbie in vb and Sql server... Is possible to create and attaching, via vb classic or VBA, a sql database in this instance:\DVD377-14D9E48CSQLEXPRESS... I have Sql Express(msde). Database name: mydatabase Database Table: mytable fileds: fiedl1 text format fiedl2 text format fiedl3 text format fiedl4 date format fiedl5 number format fiedl6 text format
View Replies !
How To Backup My Database Using Visual Basic Express 2008
I have an application written with Visual Basic Express 2008, which has a Sql Server Express Compact database incorporated into the application. I've been trying to follow the suggestions listed on several threads on how to backup up my database and have not gotten very far. The following code seems to be in most threads. Dim dbstring = "Data Source=.SQLExpress;Integrated Security=true;User Instance=true;AttachDBFilename=|DataDirectory|ImmuLogDataBase.sdf" Dim sqlconn As New SqlClient.SqlConnection(dbstring) sqlconn.Open() When run, this code returns the following error at the sqlconn.Open() command. An attempt to attach an auto-named database for file G:ImmuLogImmuLoginDebugImmuLogDataBase.sdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. My solution is saved on a flash drive which I take between home and work. I'm hoping that that isn't the issue. I believe that Visual Basic loads the database when it starts and it is already open when this code is run. Is there a way to access this open database and run a backup procedure on it from within VB express 2008? I'm new to this and self taught so explain everything in detail. Thanks for your help. Bruce
View Replies !
I Cannot Create A Brand New MDF (sql Server Database) With Visual Basic 2005
Hi everybody: I go to Server Explorer, right click on Data Connection, input the server name (that is, my own computer), give a new name to the database to create, and then inevitably get the error window saying: An error occurred while establishing a connection to the server. When connectiong to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL server does not allow remote connections. (Provider: Named Pipes Provider, error 40, could not open a conection to SQL Server) So, how to open a connection to SQL server 2005? I looked in the msdn but found absolutely nothing. Please help Paolo
View Replies !
How Can I Copy The Content Of MS Access Table In Database SQL Using Visual Studio Basic
Code Snippet Hi there, I'm struggeling for more than a week now with this problem, without a finding the solution. I have two databases, MS Access and SQL Server 2005 Express Edition Using a procedure in Visual Studio i would like to copy all the records from one table in MS Access into an existing table in SQL Server (the tables have the same name and the same layout) I tried to prepare one Dataset to copy from Access into SQL Server but when i run the command 'DaSQL.Update(DsSQL, "Tabella") nothing happens (not even an exeption has been raised), looking during debug, the DataSet seems filled though... Please could anyone explain what's wrong and / or is there a more quicker way to copy data from a table to another? Note i woul have as a final goal to get data from an AS400 database by ODBC, manage it, and put it on SQL Server for a 'data mining' scope (eliminating the use of MS Access, not suited for FE-BE). the procedure goes like this; ' Create a connection to the MS Access Database Dim connectionToAccess As New OleDbConnection(DBConnectionAccString) strsql = "SELECT * FROM [TABELLA]" connectionToAccess.Open() Dim DaAccess As New OleDbDataAdapter(strsql, connectionToAccess) Dim DsAccess As New DataSet("ACCESS") DaAccess.FillSchema(DsAccess, SchemaType.Source, "Tabella") DaAccess.Fill(DsAccess, "Tabella") ' Create a connection to the SQL Database Dim connectionToSQL As New SqlConnection(DBConnectionSQLString) connectionToSQL.Open() Dim DaSQL As New SqlDataAdapter(strsql, connectionToSQL) Dim DsSQL As New DataSet("SQL") DaSQL.FillSchema(DsSQL, SchemaType.Source, "Tabella") DaSQL.Fill(DsAccess, "Tabella") DaSQL.Update(DsSQL, "Tabella") Note I tried also the following, withou a result; DsSQL = DsAccess.Copy DaSQL.Update(DsSQL, "Tabella") Please is there someone who could respond !!???
View Replies !
Loading Images In A SQL Server Express Database Table At Design Time Using Visual Basic Net Express Editon
I am new to this type of programming and and have read all articles on adding an image to the database and it seems they all use sql queries to add an image but I want to add an image at design time. I am using Visual Basic 2005. I am also using Visual Basic 2005 Express Edition to try the same thing. I am trying to build a Translator program for english to Brazilian Portuguese and the reason I want to add the images is so that when I translate the word cat from english to Portuguese, I can also show an image of a cat. Can anyone please help me
View Replies !
DTS Visual Basic DLL
Hi, Can anyone provide a code sample for exporting a view into a txt file using the DTS object model I want to create a vb dll that can be call from a stored procedure using sp_OA and pass the name of the view into the dll and export the view as a txt file All the help is appreciated thanks
View Replies !
Visual Basic
I need help. 160821A network error was encountered while sending results to the front end. Check the SQL Server errorlog for more information. I need help. Our SQL Server is crashing. The Database is still recovering. I can not kill any Process when the Server crashed. I shoot down and restarted the server. Nothing to do. I can not access to the database. It is recovering. How long? I do not know. What can be the reason of the recovering? Nor the event log of Windows NT or the log files of the SQL SERVER can help me. Here is a part of the log file 23216Arithmetic overflow error for type %s, value = %f. 10915There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. 99/01/19 01:14:25.69 spid25 bufwait: timeout, BUF_IO, bp 0x1bba600, pg 0x11b50, stat 0x801000/0x6, obj 0x23494814, bpss 0x124a2a0 99/01/19 01:14:27.15 ods Error : 17824, Severity: 10, State: 0 99/01/19 01:14:27.15 ods Unable to write to ListenOn connection '.pipesqlquery', loginname 'sa', hostname 'myserver'. 99/01/19 01:14:27.15 ods OS Error : 232, The pipe is being closed.
View Replies !
DTS And Visual Basic
I have already created package which loads a text file to database using the dts wizard in Enterprise Manager.How do I execute that package using visual basic?Please provide the Code!!!Thanks
View Replies !
Visual Basic 6.0
Greetings, Firstly, apologies if this topic is out of the scope of this board, but I am stumped. Basically, we have an old Visual Basic 6.0 application which currently accesses an Access database, but which we would like to upgrade to an SQL compact edition database. I have created the database, but have so far turned up next to no details reagarding how to connect to the damn thing in VB6. Can anyone help? Or at least point me in the right direction? Many thanks, MadSkunk
View Replies !
Run DTS Package From Visual Basic 6.3
Anyone have any code i can use to call a DTS package from Visual Basic. I would like to have an outlook macro that will run a dts package when i receive an email. All i need is the code that will call a dts package for a sql server that is not local to the box. I've tried this code but i get an error run_tmie error '-2147217900 (80040e14)' automation error Public Sub main() Dim oPkg As DTS.Package2 Set oPkg = New DTS.Package2 oPkg.LoadFromSQLServer MyServerName, MyUserName, MyPassword, , MyDTSPackageName oPkg.Execute oPkg.UnInitialize Set oPkg = Nothing End Sub Thanks in advance.
View Replies !
Visual Basic And Sql Server
Hi experts I am new to SQL Server and have got to do a project using VB & SQL Server. right now i got to prepare case study document wherein i got to mention the pros & cons of using VB+sql server... kindly help me. Thanks in advance.
View Replies !
DBCC From Visual Basic
I`d like to issue a DBCC NEWALLOC statement from VB and get the same results I get back from ISQL/W. I tried getting the results via a recordset to no avail. When using SQLOLE the "NO_INFOMSGS" parameter is somehow automatically appended? Anyone know how to do this? Thanks JF
View Replies !
What Are You Using Visual Basic Or Java
I'm currently using Vision Builder, is a program that generates the data model to SQL SERVER 6.5 and the application to Visual Basic 5. My problem is that the company (Vision Software) that makes Vision Builder would not be making any new releases of Vision Builder that would support SQL 7.0. They are forcing me to change the their new tool called Vision Jade that generates the application to MS J++ (Java). Can anyone tell me if the correct thing to do is abandon Visual Basic and migrate to Java with SQL 7.0, or should I get another tool that continues with Visual Basic and SQL 7.0. Thanks
View Replies !
ADO WITH VISUAL BASIC /SQL SERVER
I need help I am getting this error: The operation requested requested by the application is not supported by the provider. I am running the Project reference "ActiveX data objects 2.0 Library". The connection and loading of data work very well. Update and Delete do not work. With rdo I habe no problem. dim rs as new adodb.recordset With rs Select Case Index Case 0 'Neu .AddNew .Fields("St_Date") = Text1(0).Text .Fields("EDate") = Text1(1).Text .Fields("Ert") = text1(2).Text .Fields("D_tion") = text1(3).Text .Fields("S_kon") = Text1(4).Text .Update end with What'S wrong? The syntax in MSDN IS RECORDSET.AddNew(fieldlist,values) Thanks Dr Bangaly Diane
View Replies !
Dts Package In Visual Basic
Hi All, I created a package that will connect to a table in sql server. The table contains table_name which has to be exported from the source database to the destination database. My package seems to work okay. Except that some of the table in the source database has dependant procedures and views which I want to export to my destination table. Write now only the tables and its dependant tables are being exported. My package looks something like this! Option Explicit Public goPackageOld As New DTS.Package Public goPackage As DTS.Package2 Private Sub Main() Set goPackage = goPackageOld goPackage.Name = "pkg_name" goPackage.Description = "DTS package description" goPackage.WriteCompletionStatusToNTEventLog = False goPackage.FailOnError = False goPackage.PackagePriorityClass = 2 goPackage.MaxConcurrentSteps = 4 goPackage.LineageOptions = 0 goPackage.UseTransaction = True goPackage.TransactionIsolationLevel = 4096 goPackage.AutoCommitTransaction = True goPackage.RepositoryMetadataOptions = 0 goPackage.UseOLEDBServiceComponents = True goPackage.LogToSQLServer = False goPackage.LogServerFlags = 0 goPackage.FailPackageOnLogFailure = False goPackage.ExplicitGlobalVariables = False goPackage.PackageType = 0 '--------------------------------------------------------------------------- ' create package steps information '--------------------------------------------------------------------------- Dim oStep As DTS.Step2 Dim oPrecConstraint As DTS.PrecedenceConstraint '------------- a new step defined below Set oStep = goPackage.Steps.New oStep.Name = "Copy SQL Server Objects" oStep.Description = "Copy SQL Server Objects" oStep.ExecutionStatus = 1 oStep.TaskName = "Copy SQL Server Objects" oStep.CommitSuccess = False oStep.RollbackFailure = False oStep.ScriptLanguage = "VBScript" oStep.AddGlobalVariables = True oStep.RelativePriority = 3 oStep.CloseConnection = False oStep.ExecuteInMainThread = False oStep.IsPackageDSORowset = False oStep.JoinTransactionIfPresent = False oStep.DisableStep = False oStep.FailPackageOnError = False goPackage.Steps.Add oStep Set oStep = Nothing '--------------------------------------------------------------------------- ' create package tasks information '--------------------------------------------------------------------------- '------------- call Task_Sub1 for task Copy SQL Server Objects (Copy SQL Server Objects) Call Task_Sub1(goPackage) '--------------------------------------------------------------------------- ' Save or execute package '--------------------------------------------------------------------------- 'goPackage.SaveToSQLServer "(local)", "sa", "" goPackage.Execute goPackage.UnInitialize 'to save a package instead of executing it, comment out the executing package line above and uncomment the saving package line Set goPackage = Nothing Set goPackageOld = Nothing End Sub '------------- define Task_Sub1 for task Copy SQL Server Objects (Copy SQL Server Objects) Public Sub Task_Sub1(ByVal goPackage As Object) Dim sConnect As String Dim m_dbConnect As New ADODB.Connection Dim rs As New ADODB.Recordset Dim test As Variant Dim oTask As DTS.Task Dim oLookup As DTS.Lookup Dim oCustomTask1 As DTS.TransferObjectsTask2 'Opening the database sConnect = "Provider=SQLOLEDB;Server=servername;Uid=sa;Pwd=;D atabase=source_db" m_dbConnect.Open sConnect 'Opening a recordset rs.Open "table_list", m_dbConnect Set oTask = goPackage.Tasks.New("DTSTransferObjectsTask") Set oCustomTask1 = oTask.CustomTask oCustomTask1.Name = "Copy SQL Server Objects" oCustomTask1.Description = "Copy SQL Server Objects" oCustomTask1.SourceServer = "servername" oCustomTask1.SourceUseTrustedConnection = True oCustomTask1.SourceDatabase = "source_db" oCustomTask1.DestinationServer = "servername" oCustomTask1.DestinationUseTrustedConnection = True oCustomTask1.DestinationDatabase = "destination_db" oCustomTask1.ScriptFileDirectory = "C:Program FilesMicrosoft SQL Server80Tools" oCustomTask1.CopyAllObjects = False oCustomTask1.IncludeDependencies = True oCustomTask1.IncludeLogins = False oCustomTask1.IncludeUsers = False oCustomTask1.DropDestinationObjectsFirst = True oCustomTask1.CopySchema = True oCustomTask1.CopyData = 1 oCustomTask1.ScriptOption = -2146995971 oCustomTask1.ScriptOptionEx = 17305616 oCustomTask1.SourceTranslateChar = True oCustomTask1.DestTranslateChar = True oCustomTask1.DestUseTransaction = False oCustomTask1.UseCollation = False 'Looping through the recordset rs.MoveFirst Do Until rs.EOF 'Retrieving the table names 'test = rs!TABLE_NAME oCustomTask1.AddObjectForTransfer rs!table_name, "dbo", 8 rs.MoveNext Loop goPackage.Tasks.Add oTask Set oCustomTask1 = Nothing Set oTask = Nothing End Sub Can someone tell me what am I doing wrong here. Thank you!
View Replies !
Visual Basic, OLE DB Provider And DTS
I want to use Visual Basic to create DTS connection. In the example below a connection is created using an ODBC string. However, I would like to make the Connection's DataSource be an OLE-DB provider instead of ODBC. However, I cannot find any information on the syntax for using an OLE-DB provider as the DataSource. Your help is appreciated. Les strODBCdsn = "server1" 'Create a DSN called SQL7 or change name strUserName = "sa" 'User name assume same source and dest strPassword = "" 'with the same Password Set oConnection = oPackage.Connections.New oConnection.ID = 1 oConnection.DataSource = strODBCdsn oConnection.UserID = strUserName oConnection.Password = strPassword oPackage.Connections.Add oConnection
View Replies !
How To Connect To Visual Basic 6.0
Hi iam having vb 6.0 and i want to connect it with backend Ms sql server 2000 can any one help me and i want to make my vb application as exe file. so is there any possibility to connect to sql server2000 even i made the application as exe so that it should always connected to db thank you
View Replies !
SQL CE Trouble In Visual Basic 6
I use SQL Server 2005 Compact Edition RC1 with Visual Basic 6.0. connection provider that i use is Microsoft.SQLSERVER.MOBILE.OLEDB.3.0. for database management i use SQL Server Management Studio. some query can't execute in visual basic but in sql management studio, that query can run very well. for example: 1. select KodeSatker, KodeSatker + ' - ' + Nama as Nama from TMSatker where len(kodesatker)=3 order by KodeSatker 2. Select a.kdprog, a.nama, b.kodesatker + ' - ' + b.nama as SKPD, a.nonurusan from TMProgram a left join TMSatker b on substring(a.kdprog, 1, len(a.kdprog) - 2) = b.kodesatker 2 query above can run in sql management studio, but in visual basic 6.0, that query have an error. error msg:run time error '2147217887 (80040e21)': multiple-step operation generated errors. check each status value how to solve that problem? thanks before.
View Replies !
Which Better For Visual Basic Developer
hi i found these books for learnning sql server which better to read for Visual Basic Developer ?? http://www.sqlserver2005books.com/1-3805-0735622507-%20Microsoft_SQL_ServerTM_2005_Reporting_Services_Step_by_Step_Step_by_Step_Microsoft.html ------------------------ http://www.sqlserver2005books.com/1-3805-0735622078-%20Microsoft_SQL_ServerTM_2005_Database_Essentials_Step_by_Step_Step_By_Step_Microsoft.html thank you
View Replies !
Can't Connect To Sql Server Database With Same Connection Used In Visual Studio .net 2003
I have the following code that works fine in visual studio .net 2003 but not with VWD. I have sql server 2000 developer edition installed locally and this connection works fine with visual studio. With VWD it fails with the exception "System.Data.SqlClient.SqlException: Login failed for user 'DARRELLASPNET'". It fails on the conn.Open line. any ideas on what the issue is?Dim conn As SqlConnectionDim connstr As Stringconnstr = "Data Source=DARRELL;Initial Catalog=Event;Integrated Security=SSPI;"Dim daEvents As New SqlDataAdapter("select * from events", connstr)Dim ds As New System.Data.DataSet conn = New SqlConnection(connstr)conn.Open()daEvents.Fill(ds) conn.Close()conn.Dispose()
View Replies !
Basic Sql Querying In Visual Web Developer
I'd like to be able to query a database to get the value of a certain row. However, I'd like to save this value into a variable and use them as I'd like, NOT nessessarily display them in a data control such as a gridview etc. I've been able to find a lot of information on binding datasourses to predefined data controls, but I can't find anything on simply querying a database for values and using those values to display a page as I want.My basic end goal is to create what's basically a shopping site like Amazon only for about 100 or so products.Thanks in advance for any help. I'm just getting into Visual Web Developer so please excuse my ignorance and lack of posts.
View Replies !
Visual Basic Executes DTS Package
I have created a rule in outlook to run this Visual Basic Script when I receive a specific email. The codes runs a SQL Server DTS Package that imports data and runs a couple of stored procs. If the DTS package takes a while to execute my outlook will lock up until the entire package is complete. I want to run the DTS package to run but I don’t want the application to remain locked till its complete. Anyone have any ideas of how to get around this.... Public Sub RunTVDTSPackage(Item As Outlook.MailItem) Dim oPackage As New DTS.Package On Error GoTo eh oPackage.LoadFromSQLServer "DummyServerName", "DummyUser", "DummyPSWd", _ DTSSQLStgFlag_Default, _ "", "", "", "Top_Customer - TV", 0 'Execute the Package oPackage.Execute 'MsgBox oPackage.Description, vbInformation, _ "Re-import Excel sheet." 'Clean up. MsgBox ("Ran DTS Package") Set oPackage = Nothing Exit Sub eh: MsgBox Err.Description, vbCritical, _ "Error Running Package" End Sub
View Replies !
Collates - CP437 - ADO - Visual Basic
Hello, I am workink with a Database that has the Collate SQL_Latin1_General_CP437_CI_AS (Instance and Database-SQL2000), this convert the Database in a OEM Server. I Can save Characters From 0 to 256 ASCII code CP 437 very well on the database (I import this Data with an DTS) but when i retrive the information with Visual Basic 6.0 with ADO some character > 127 are changed. Did you know how I can fix It ? I know that the problem is that Windows is ANSI and my SQL Server OEM, but .. a dont´t know how yo fix it. Thanks I sorry because my poor english. :( Walter Argentina
View Replies !
Opening SQL Server In Visual Basic
Hi, I just started using SQL server today. We upsized an Access database to SQL server and now my Visual Basic program cannot open the tables. The following code works when the database is in Access. What is the proper format open a table in SQL server if I want to call it through an MS Access DB? Public Data_Queries As Recordset Set ClinTrack = DBEngine.Workspaces(0).OpenDatabase("R:CLINICALPRI VATECLINTRAKTESTCLINTRAK.MDB") Set Data_Queries = ClinTrack.OpenRecordset("Data_Queries", dbOpenTable) Thanks, Marta
View Replies !
Visual Basic .NET, SQL2000 && Images
I am creating a program in VB .NET to insert an image in one of the fields in MS SQL2000. VB variant type DIM'd as "Image", SQL field type is "Image". I cannot get the SQL insert statement to work. I'm trying to get a single insert statement to fill all fields in the row, one of which is image. error=Operator '&' is not defined for types 'String' and 'System.Drawing.Image' The '&' symbol is used to concatenate the SQL statements items Any easy way to store an image?
View Replies !
Reporting Services From Visual Basic 6.0
Hi, I have installed Sql-server 2005 ,and i Create New reports with Reporting Services I have an aplication in Visual Basic 6.0 .Actually Used Microsoft Access for Report Design. I like to use Rreporting Services,But is possible to call from visual basic 6.0 the designeds reports ? And is posible to pass parameters to the report ? (like view in access ) Thanks
View Replies !
VB.Net (Visual Basic 2005) And MySQL 5.0.41
Please help me, i am having trouble in Adding data in MySQL Database, and even in Getting or retrieving Data as well. I use the connection string of Visual Basic 6.0 (ODBC 3.51). Nothing goes wrong with the connection but in updating and adding new data in the MySQL Database then...that's it, nothings go Right! Please help me in this matter, or can somebody to please give me some simple codes like Address Book using the Visual Basic 2005... pls pls pls pls pls.... thanx a lot!!! polarmont@yahoo.com
View Replies !
Visual Basic 2005 Problem
Hi i am trying to trying to delete a reocrd from a Microsoft Access Database in Visual Basic 2005 Express Edition, but come up with this error with the following code. I'm new to vb 2005 and I'm no expert. Appreciate any help given. ----------------- InvalidCastException was unhandled Unable to cast COM object of type 'System.__ComObject' to class type 'System.Windows.Forms.TextBox'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface Dim db1 As Connection Dim rs As Recordset db1 = New ADODB.Connection db1.Provider = "Mircosoft.jet.OLEDB.4.0;" db1.ConnectionString = "Provider = 'Microsoft.Jet.OLEDB.4.0';Data Source = 'M:Year2 New262CSvb cwrk1vb cwrk1orders.mdb';" db1.Open() rs = New ADODB.Recordset rs.Open("select * from orders", db1, ADODB.CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic) txtOrderID = rs("OrderID") txtProduct = rs("Product") txtPrice = rs("UnitPrice") txtQuantity = rs("Quantity") txtDate = rs("OrderDate") txtRecieved = rs("Received") txtSupplierID = rs("SupplierID") Also when i try to add a record to a database i get the following error i have made sure all the data i have typed in the text boxes are the correct data types. COME Exception was unhandled No value given for one or more required parameters. Dim objcommand As Command = New Command() Dim conn As Connection = New Connection() Dim cmdreader As Recordset = New Recordset conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=M:Year2 New262CSvb cwrk1vb cwrk1orders.mdb") objcommand.ActiveConnection = conn Dim stqSQLInsert As String stqSQLInsert = "INSERT INTO Orders(OrderID, Product, Unitprice, Quantity, Orderdate, Received, SupplierID) VALUES (txtOrderID.Text, txtProduct.Text, txtPrice.Text, txtQuantity.Text, txtDate.Text, txtReceived.Text, txtSupplierID.Text)" objcommand.CommandText = stqSQLInsert cmdreader.Open(stqSQLInsert, conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic) objcommand.Execute() cmdreader.Update() Thnx to any who helps...
View Replies !
Syscomments.text And Visual Basic 6
Has anyone experienced problems calling stored procedures that references syscomments.text from Visual Basic 6? I have a stored procedure that finds all tables referenced by a specific stored procedure. It works well when I call it from SQL Server Management Studio, but there are cases where it does not find the tables when I call it from VB 6. I've isolated the failure it to a specific condition in the WHERE clause: SELECT @howfar = so.id FROM SYSOBJECTS so LEFT OUTER JOIN syscomments sc on so.ID = sc.ID Where lower(so.name) = lower('storedProcName') AND lower(sc.TEXT) LIKE '%' + lower('update') + ' ' + lower('tableName') + '%' The call from VB works (finds the record) if " AND lower(sc.TEXT) LIKE '%' + lower('update') + ' ' + lower('tableName') + '%' " is omitted, and fails (does not find any records, no error is raised) if that condition is included. I should also add that the VB Call does work for some combinations of stored procedures and tables. The old SET NOCOUNT ON trick does not make any difference.
View Replies !
SQL Express && Visual Basic 2005
Hello, Iam new to Visual basic 2005, I have installed SQL Express and prefers to use ADODB to connect to the database. This is the code i tried con.Open(cstring1 = "Provider=SQLNCLI.1;" _ & "Server=(local);" _ & "Database=D:VS 2005 ProjectsMyDB.mdf;" _ & "Integrated Security=SSPI;" _ & "DataTypeCompatibility=80;" _ & "Data Source=server1sqlexpress") The error is comexception was unhandled, SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. Can anyone help me out. I have SQLExpress installed and Visual studio 2005 installed. Connection string for ADODB ?? Regards, Sathyan
View Replies !
Visual Basic 2005 Express - SQL Problem
Hi all, I have a var called sEP which contains a number. The problem I have is calling that var during an SQL query within Visual Basic. To test the update string I wrote the following query and simply told it to enter the text "Five Stars" on the row which contains the entry '1' in Episode Number column. It works fine. UPDATE JackBennySET Rating= 'Five Stars' WHERE ([Episode Number]= '1') But how do I replace the '1' in the query with the var sEP (which will contain the actual number I want the query to run against)?I have tried various suggestions from sources including:UPDATE JackBenny SET Rating = 'Five Stars' WHERE [Episode Number] = '" + sEp + "'However, they all fail to update the database at all which makes me think the syntax is incorrect.Any help is very appreciated (I have been seeking help in various places for 2 days now) - I always send small paypal tips to people who help me on forums.
View Replies !
Accessing Publication Properties From Visual Basic (VB6)
Hi all,I have an existing application that checks a few things before itlaunches another application. One thing that the application needs tocheck is the subscription properties of both the local database and theremote (LAN) server.I've stumbled upon some properties but I am trying to fit in the lastones and I can't seem to find the right code to accomplish this... Cananyone shine a little light on this please ?The following code queries the SQL Server (remote) to get (some of) theproperties of the replicated database. What I would like to fit inafter the 'state' are the properties that you can retrieve with theEnumAllSubscriptions function. However, I can't seem to find the rightobject (sample code) to retrieve those (or I'm just overlooking theobvious)...Here is (part of) the code I'm using to query the publication on theremote server :Dim oMergePublication As SQLDMO.MergePublication2Dim oSubscription As SQLDMO.MergeSubscription2Me.lstPublications.ClearFor Each oReplicationDatabase InobjSQLSERVER.Replication.ReplicationDatabasesIf oReplicationDatabase.Name = Me.txtSQLServerDatabase.TextThenFor Each oMergePublication InoReplicationDatabase.MergePublicationsbFoundReplicated = TrueMe.lstPublications.AddItem "Database replicated as'" & oMergePublication.Name & "'"For Each oSubscription InoMergePublication.MergeSubscriptionsMe.lstPublications.AddItem " - subscriber:" & oSubscription.SubscriberMe.lstPublications.AddItem " - localDB :" & oSubscription.SubscriptionDBMe.lstPublications.AddItem " -state :" & GetReplStatus(oSubscription.Status)NextNext'For Each osubscriber In oReplicationDatabase.'NextEnd IfNextSet oReplicationDatabase = NothingSet oMergePublication = NothingAfter this, I also want to check the local DB (=pulled subscription)and show some of the properties (from EnumAllSubscriptions). Forexample to warn the user about the need to synchronise (last_updatedvalue)...Any help appreciated,Many thanksGB--Your eyes are weary from staring at the CRT. You feel sleepy. Noticehow restful it is to watch the cursor blink. Close your eyes. Theopinions stated above are yours. When I snap my fingers, you cannotimagine why you ever felt otherwise. <snap>
View Replies !
Visual Basic 6.0 Connect To SQL Server 2000
We have forms written in Visual Basic 6.0. They were previouslywritten for an Access database which was moved to SQL Server 2000.Here's the connect string I used:ODBC;UID=visualbasic;PWD=password;SERVER=MPSQL;DRI VER={SQLSERVER};DATABASE=MPPhotoThe user visualbasic and the user logged in to the computer have fullrights to the database.When they open the form which is based on a view it is opened as readonly with an error 3027. The data control is not set to read only.The database file is not read only. All of the permissions are set toallow this user read, write and modify.Can anyone hep me?
View Replies !
Error In Executing A DTS Package From Visual Basic
Hi! Good Day! I am executing a DTS PAckage from Visual Basic. My code is this: objPackage.LoadFromSQLServer "SERVER", , , _ DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage1" objPackage.Execute objPackage.LoadFromSQLServer "SERVER", , , _ DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage2" objPackage.Execute The first DTS package was executed successfully, but when it hit the second package, an error occurs: Step 'DTSStep_DTSDataPumpTask_1' already exists in the collection. Please help. Thanks.
View Replies !
|