473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Load form parsing errors

Hey Ronald

Thanks for the response. Could you look at my form_load and give me advice. I keep getting a syntax error and i think i am missing something obvious

Dim conn As New ADODB.Connection
Dim rs As New Recordset
Set conn = New ADODB.Connection
Set rs = New Recordset
'On Error GoTo Err
conn.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=l7a.info;Port=3306;DATABASE=****;UI D=******;PWD=****;OPTION=16427"
rs.Open "Select * from `storloc`", conn
rs.MoveNext
'heres the code i added
Do Until rs.EOF = True
Combo1.AddItem rs.Fields("city").Value
rs.MoveNext
'end of new code
If rs.EOF = True Then
GoTo Done
End If
Loop
Done:
rs.Close
conn.Close

Use the SELECT DISTINCT col_name FROM ..etc...in your query.

Ronald :cool:
Jan 19 '07 #1
2 1019
ronverdonk
4,258 Expert 4TB
This is a typical VB question. Therefore I'll split this thread from this post on and move that to the VB forum with the title "Load form parsing errors". Good luck.

Ronald :cool:
Jan 19 '07 #2
Killer42
8,435 Expert 8TB
Thanks for the response. Could you look at my form_load and give me advice. I keep getting a syntax error and i think i am missing something obvious
You weren't very specific about the error. However, one thing I found when I copied your code is that in the SELECT string, the single quotes... well, aren't single quotes. They look as though they may have been converted by MS Word's "smart quotes" or something similar.

Putting CODE tags around things makes this kind of thing easier to spot...
Expand|Select|Wrap|Line Numbers
  1. Dim conn As New ADODB.Connection
  2. Dim rs As New Recordset
  3. Set conn = New ADODB.Connection
  4. Set rs = New Recordset
  5. 'On Error GoTo Err
  6. conn.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=l7a.info;Port=3306;DATABASE=****;UID=******;PWD=****;OPTION=16427"
  7. rs.Open "Select * from `storloc`", conn
  8. rs.MoveNext
  9. 'heres the code i added
  10. Do Until rs.EOF = True
  11.   Combo1.AddItem rs.Fields("city").Value
  12.   rs.MoveNext
  13.   'end of new code
  14.   If rs.EOF = True Then
  15.     ' GoTo Done
  16.     Exit Do
  17.   End If
  18. Loop
  19. ' Done:
  20. rs.Close
  21. conn.Close
Um... come to think of it, why does your table (or query) name have single quotes around it, anyway? And why are you skipping the first record? (Or did I misunderstand the point of the MoveNext?)

(Note, I changed the GoTo to Exit Do and removed the Done label. Many programmers will scream if they see a GoTo statement.)
Jan 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: php newbie | last post by:
Hello, I am learning php. I have created a simple Web page with a form. After receing the POST request, I do some error checking. In case of errors, I would like to re-post the page, but with...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
3
by: Ed Brandmark | last post by:
I have a tag of the form <SCRIPT LANGUAGE="JavaScript1.1" SRC="foo.js"..... and was wondering if this delays the loading of my page until that file foo.js downloads. It seems that if I place...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
3
by: feng | last post by:
We have a windows form project that has multiple child forms inherit from one base form. In our base form's form load event handler, we have some common logic in there. These common logic is...
6
by: Tom | last post by:
Is there ANY easy way to close a MDI Child form in the middle of it's load? For instance, during the Load event I find a need to close the form (for whatever reason - maybe the user isn't ready for...
2
by: Esa | last post by:
Hi, I'm having problems with one strange web system where submitting an application and making queries about its handling status require a series of form submits and response parsing - all in...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
3
by: =?Utf-8?B?SGVyYg==?= | last post by:
I've developed an ASP.NET website that runs fine on my local WinXP IIS and on my server's IIS, both are IIS6.0 The site uses a master page that has the following declaration: <%@ Master...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.