PDA

View Full Version : Visual Studio Visual Basic - where to get help



Kicker
06-06-2016, 04:58 PM
Just installed Visual Studio 2015 Community and need to create a db application. I have used VB6 in the past but some of the syntax has changed. Does anyone know of a forum that might help?

What I am really wanting to do is create some dynamic recordsets.

jonh
06-10-2016, 04:34 PM
vb6 and vb.net aren't too dissimilar. ADO should be pretty much indistinguishable between the two. You'll need to be more specific.

Kicker
06-10-2016, 04:51 PM
Appreciate your response.

In MS Access, I use the following very frequently to create a dynamic recordset.


Dim rstWWNumber As ADODB.Recordset
Dim strSelect As String


strSelect = "SELECT * from qWWNumber"

Set rstWWNumber = New ADODB.Recordset

rstWWNumber.Open strSelect, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rstWWNumber.MoveFirst

rstWWNumber.Close

What I am looking to do is use something similar.

jonh
06-10-2016, 05:07 PM
yeah, ok. but what problems have you encountered using that code with "Visual Studio 2015 Community" ?

Kicker
06-10-2016, 07:09 PM
jonh:

It doesn't work. Seriously though.

I'll try it again with another couple of modifications, but I keep getting multiple error messages and the more I get, the more frustrated I get.

jonh
06-11-2016, 02:41 AM
Before you can can get a recordset, you need to establish a connection to the database.
Access is all about databases so it always has a connection to the database you have open (CurrentProject.Connection in your code).
Outside of Access, or if you want to connect to a different database, you need to set up the connection using an appropriate connection string or DSN.

https://www.connectionstrings.com/

Kicker
06-11-2016, 03:54 PM
john:

I am sorry but I just don't seem to be able to put two and two together. Please bear with me and thank you in advance for your help.

First of all, I have an Access 2016 accdb file with two different tables. Because of the user audience, I want to use visual basic to create an .exe file for the user interface. Based on the 'users' computer experience, we need to make things as bullet proof as possible. For example: A quick form will have text boxes and not be bound to any connection or table.

The user will not have the ability to move around and look at data as there will be no navigation available. After entering their data, the user will click command button.

The command button will create the connection, dynamically create a recordset, addnew, update and close.

I'm just having a brain fart.

I has been a good 10+ years since I used VB6 and the code I had used isn't working

Public rsConnect As String
Public sqlSelect As String
Public rstTest As New ADODB.Recordset ----- this line of code is returning errors.

Do you have an example that you could post?

jonh
06-12-2016, 02:49 AM
Have you added the reference?

should be
Project > add reference > COM >microsoft activex data objects x.x library.